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:

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

  1. Open your terminal by pressing Ctrl + Alt + T.

  2. Run the following command to update the package list:

    sudo pacman -Sy
    
  3. Install Docker using the following command:

    sudo pacman -S docker
    

Install Docker Compose

  1. Run the following command to install Docker Compose:

    sudo pacman -S docker-compose
    

Step 2: Create a Configuration File

  1. Create a directory for the imgproxy configuration file:

    sudo mkdir /etc/imgproxy
    
  2. Change the ownership of the directory to your user:

    sudo chown $USER:$USER /etc/imgproxy
    
  3. Navigate to the newly created directory:

    cd /etc/imgproxy
    
  4. Create a new file named config.toml:

    nano config.toml
    
  5. Copy the following code and paste it into the config.toml file:

    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=="
    
  6. Save and close the file by pressing Ctrl + X, followed by Y, then Enter.

Step 3: Fetch and Run Imgproxy

  1. Create a new directory for the imgproxy files:

    sudo mkdir -p /var/lib/imgproxy
    
  2. Change the ownership of the directory to your user:

    sudo chown $USER:$USER /var/lib/imgproxy
    
  3. Navigate to the newly created directory:

    cd /var/lib/imgproxy
    
  4. Fetch the latest imgproxy image using Docker:

    sudo docker pull darthsim/imgproxy
    
  5. Create a new file named docker-compose.yml:

    nano docker-compose.yml
    
  6. Copy the following code and paste it into the docker-compose.yml file:

    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"
    
  7. Save and close the file by pressing Ctrl + X, followed by Y, then Enter.

  8. 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.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!