How to Install Imgproxy on Manjaro
Imgproxy is an open-source image resizing server that bypasses the traditional way of resizing images on the fly. This tutorial will guide you on how to install and set up imgproxy on Manjaro.
Prerequisites
Before you proceed with the installation of imgproxy on Manjaro, make sure that you have the following requirements:
- An instance of Manjaro with root user access
- Docker installed on the system
- Docker Compose installed on the system
Step 1: Install Docker and Docker Compose
If you haven't installed Docker and Docker Compose on your system, you can follow the instructions below:
Install Docker
Open your terminal by pressing
Ctrl + Alt + T.Run the following command to update the package list:
sudo pacman -SyInstall Docker using the following command:
sudo pacman -S docker
Install Docker Compose
Run the following command to install Docker Compose:
sudo pacman -S docker-compose
Step 2: Create a Configuration File
Create a directory for the imgproxy configuration file:
sudo mkdir /etc/imgproxyChange the ownership of the directory to your user:
sudo chown $USER:$USER /etc/imgproxyNavigate to the newly created directory:
cd /etc/imgproxyCreate a new file named
config.toml:nano config.tomlCopy the following code and paste it into the
config.tomlfile:addr = ":8080" [processing_options] enlarge_only = true [security] sign_key = "my-super-secret-key" signature_size = 32 [[sources]] url = "http://example.com/images/" header = "Authorization: Basic dXNlcjpwYXNzd29yZA=="Save and close the file by pressing
Ctrl + X, followed byY, thenEnter.
Step 3: Fetch and Run Imgproxy
Create a new directory for the imgproxy files:
sudo mkdir -p /var/lib/imgproxyChange the ownership of the directory to your user:
sudo chown $USER:$USER /var/lib/imgproxyNavigate to the newly created directory:
cd /var/lib/imgproxyFetch the latest imgproxy image using Docker:
sudo docker pull darthsim/imgproxyCreate a new file named
docker-compose.yml:nano docker-compose.ymlCopy the following code and paste it into the
docker-compose.ymlfile:version: '3.7' services: app: image: darthsim/imgproxy environment: - IMGPREFIX=/img - MAINCONFIG=/etc/imgproxy/config.toml - LOGLEVEL=debug volumes: - /var/lib/imgproxy:/img - /etc/imgproxy:/etc/imgproxy ports: - "8080:8080"Save and close the file by pressing
Ctrl + X, followed byY, thenEnter.Start the imgproxy service using Docker Compose:
sudo docker-compose up -d
The imgproxy server should now be up and running on your Manjaro system.
Conclusion
In this tutorial, we have shown you how to install and configure imgproxy on Manjaro using Docker and Docker Compose. With imgproxy, you can resize images on the fly with minimal resources and minimal configuration required.