Installing Imgproxy on Windows 10

Imgproxy is an open-source image resizing server that can help you optimize and manipulate images for different use cases. It can be easily installed and configured on Windows 10 to use it for your projects.

In this tutorial, we will guide you through the installation process of Imgproxy on Windows 10.

Prerequisites

Before diving into the installation process, you need to have the following prerequisites:

Installing Imgproxy

Follow the below steps to install and run Imgproxy on Windows 10:

  1. Open Git Bash or any other terminal console on your Windows 10 machine.

  2. Pull the Imgproxy image from Dockerhub using the following command:

    docker pull darthsim/imgproxy
    

    This command will download the Imgproxy image from Dockerhub to your local machine.

  3. Create an imgproxy directory in your C drive or any other location of your choice using the following command:

    mkdir C:\imgproxy
    

    This command will create an imgproxy directory in your C drive.

  4. Now, create a configuration file named config.yaml inside the imgproxy directory using the following command:

    cd C:\imgproxy
    touch config.yaml
    

    This command will navigate to the imgproxy directory and create a blank config.yaml file inside it.

  5. Next, open the config.yaml file using any text editor and paste the below configuration into it:

    listen_address: :8080
    
    sources:
      example:
        url: "https://example.com/"
        headers:
          Authorization: "Bearer xxxxx"
    
    server:
      read_timeout:     "30s"
      write_timeout:    "30s"
      read_header_timeout: "10s"
    
    presets:
      small:
        width:  100
        height: 100
        resize_mode: "fill"
        background: {r: 0, g: 0, b: 0, alpha: 0}
        jpeg_options: {quality: 75}
    
      medium:
        width:  300
        height: 300
        resize_mode: "fill"
        background: {r: 255, g: 255, b: 255, alpha: 0}
        jpeg_options: {quality: 85}
    
      large:
         width:  600
         height: 600
         resize_mode: "fill"
         background: {r: 255, g: 255, b: 255, alpha: 0}
         jpeg_options: {quality: 90}
    
    handlers:
      - pattern:   /my-preset/:path
        preset:    small
        source:    example
    
      - pattern:   /my-preset/medium/:path
        preset:    medium
        source:    example
    
      - pattern:   /my-preset/large/:path
        preset:    large
        source:    example
    

    This configuration file contains the server settings, sources, presets, and handlers.

  6. After pasting the configuration, save the file and close it.

  7. Now, run the below command to start the Imgproxy server:

    docker run --name=imgproxy -v C:\imgproxy:/imgproxy -p 8080:8080 -d darthsim/imgproxy -config /imgproxy/config.yaml
    

    This command will start the Imgproxy container with the mounted imgproxy directory and the config.yaml file.

  8. Verify that the Imgproxy server is running by visiting the following URL in your web browser:

    http://localhost:8080/
    

    You should see a message saying "Imgproxy is running."

That's it! You have successfully installed and configured Imgproxy on Windows 10.

Conclusion

Imgproxy is a powerful tool for image processing and resizing. In this tutorial, we have covered the installation process of Imgproxy on Windows 10. You can use this setup to optimize and manipulate images for your web or mobile applications.

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!