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:
- Windows 10
- Git Bash or any other terminal console
- Docker
- Basic knowledge of Docker
Installing Imgproxy
Follow the below steps to install and run Imgproxy on Windows 10:
Open Git Bash or any other terminal console on your Windows 10 machine.
Pull the Imgproxy image from Dockerhub using the following command:
docker pull darthsim/imgproxyThis command will download the Imgproxy image from Dockerhub to your local machine.
Create an
imgproxydirectory in your C drive or any other location of your choice using the following command:mkdir C:\imgproxyThis command will create an
imgproxydirectory in your C drive.Now, create a configuration file named
config.yamlinside theimgproxydirectory using the following command:cd C:\imgproxy touch config.yamlThis command will navigate to the
imgproxydirectory and create a blankconfig.yamlfile inside it.Next, open the
config.yamlfile 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: exampleThis configuration file contains the server settings, sources, presets, and handlers.
After pasting the configuration, save the file and close it.
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.yamlThis command will start the Imgproxy container with the mounted
imgproxydirectory and theconfig.yamlfile.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.