2018-10-04 14:59:57 +02:00
# Installation
2019-06-19 22:23:56 +02:00
There are four ways you can install imgproxy:
2018-10-04 14:59:57 +02:00
2019-09-18 14:04:01 +02:00
## Docker
2018-10-04 14:59:57 +02:00
2022-02-01 11:43:36 +02:00
imgproxy can (and this is highly recommended) be used as a standalone application inside a Docker container. Just pull the official image from Docker Hub:
2018-10-04 14:59:57 +02:00
```bash
2019-10-15 17:48:33 +02:00
docker pull darthsim/imgproxy:latest
docker run -p 8080:8080 -it darthsim/imgproxy
2018-10-04 14:59:57 +02:00
```
2022-02-01 11:43:36 +02:00
You can also build your own image. imgproxy is ready to be dockerized out of the box:
2018-10-04 14:59:57 +02:00
```bash
2020-01-29 14:01:26 +02:00
docker build -f docker/Dockerfile -t imgproxy .
2019-10-15 17:48:33 +02:00
docker run -p 8080:8080 -it imgproxy
2018-10-04 14:59:57 +02:00
```
2020-02-05 16:15:59 +02:00
## Helm
imgproxy can be easily deployed to your Kubernetes cluster using Helm and our official Helm chart:
```bash
helm repo add imgproxy https://helm.imgproxy.net/
# With Helm 3
helm upgrade -i imgproxy imgproxy/imgproxy
# With Helm 2
helm upgrade -i --name imgproxy imgproxy/imgproxy
```
2022-02-01 11:43:36 +02:00
Check out the [chart's README ](https://github.com/imgproxy/imgproxy-helm ) for more info.
2020-02-05 16:15:59 +02:00
2019-09-18 14:04:01 +02:00
## Heroku
2018-10-04 14:59:57 +02:00
2022-02-01 11:43:36 +02:00
imgproxy can be deployed to Heroku with the click of a button:
2018-10-04 14:59:57 +02:00
2019-06-17 13:54:11 +02:00
[![Deploy ](https://www.herokucdn.com/deploy/button.svg )](https://heroku.com/deploy?template=https://github.com/imgproxy/imgproxy)
2018-10-04 14:59:57 +02:00
2022-02-01 11:43:36 +02:00
That being said, you can also do it manually in just a few steps:
2018-10-04 14:59:57 +02:00
```bash
2019-10-15 17:48:33 +02:00
git clone https://github.com/imgproxy/imgproxy.git & & cd imgproxy
heroku create your-application
heroku stack:set container
git push heroku master
2018-10-04 14:59:57 +02:00
```
2019-09-18 14:04:01 +02:00
## Packages
2019-06-19 22:23:56 +02:00
2019-09-18 14:04:01 +02:00
### Arch Linux and derivatives
2019-06-19 22:23:56 +02:00
[imgproxy ](https://aur.archlinux.org/packages/imgproxy/ ) package is available from AUR.
2019-12-09 11:31:32 +02:00
### macOS + Homebrew
[imgproxy ](https://formulae.brew.sh/formula/imgproxy ) is available from Homebrew:
```bash
brew install imgproxy
```
2019-09-18 14:04:01 +02:00
## From the source
2018-10-04 14:59:57 +02:00
2022-02-01 11:43:36 +02:00
You can get the imgproxy source code by cloning the GitHub repo:
2020-07-01 13:10:09 +02:00
```bash
git clone https://github.com/imgproxy/imgproxy.git
cd imgproxy
```
...or by downloading the source tarball:
```bash
mkdir imgproxy
cd imgproxy
curl -Ls https://github.com/imgproxy/imgproxy/archive/master.tar.gz \
| tar -xz --strip-components 1 -C .
```
2022-02-01 11:43:36 +02:00
You can also download a specific version:
2020-07-01 13:10:09 +02:00
```bash
mkdir imgproxy
cd imgproxy
curl -Ls https://github.com/imgproxy/imgproxy/archive/v2.13.1.tar.gz \
| tar -xz --strip-components 1 -C .
```
2019-09-18 14:04:01 +02:00
### Ubuntu
2018-10-04 14:59:57 +02:00
2019-06-17 13:54:11 +02:00
First, install [libvips ](https://github.com/libvips/libvips ).
2018-10-04 14:59:57 +02:00
2022-02-01 11:43:36 +02:00
The Ubuntu apt repository contains a pretty old version of libvips. You can use PPA to access a more recent version of libvips:
2019-04-11 16:31:15 +02:00
2019-06-17 13:54:11 +02:00
```bash
2019-10-15 17:48:33 +02:00
sudo add-apt-repository ppa:dhor/myway
sudo apt-get update
sudo apt-get install libvips-dev
2019-06-17 13:54:11 +02:00
```
But if you want to use all the features of imgproxy, it's recommended to build libvips from the source: [https://github.com/libvips/ libvips/wiki/Build-for-Ubuntu ](https://github.com/libvips/libvips/wiki/Build-for-Ubuntu )
2022-02-01 11:43:36 +02:00
Next, install the latest version of Go:
2019-06-17 13:54:11 +02:00
```bash
2019-10-15 17:48:33 +02:00
sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt-get update
sudo apt-get install golang-go
2019-06-17 13:54:11 +02:00
```
And finally, install imgproxy itself:
2018-10-04 14:59:57 +02:00
2019-06-17 13:54:11 +02:00
```bash
2020-07-01 13:10:09 +02:00
CGO_LDFLAGS_ALLOW="-s|-w" \
go build -o /usr/local/bin/imgproxy
2019-06-17 13:54:11 +02:00
```
2018-10-04 14:59:57 +02:00
2019-09-18 14:04:01 +02:00
### macOS + Homebrew
2019-04-11 16:31:15 +02:00
2019-06-17 13:54:11 +02:00
```bash
2019-10-15 17:48:33 +02:00
brew install vips go
2020-07-01 13:10:09 +02:00
PKG_CONFIG_PATH="$(brew --prefix libffi)/lib/pkgconfig" \
2019-06-17 13:54:11 +02:00
CGO_LDFLAGS_ALLOW="-s|-w" \
CGO_CFLAGS_ALLOW="-Xpreprocessor" \
2020-07-01 13:10:09 +02:00
go build -o /usr/local/bin/imgproxy
2019-06-17 13:54:11 +02:00
```