imgproxy is an open-source image resizing server that allows you to resize images in real-time. This tutorial will guide you step by step on how to install imgproxy on Fedora CoreOS Latest.
The first step is to install Docker on the server. Docker is used to run imgproxy as a container. To install Docker, run the following command:
sudo dnf -y install docker
Next, start Docker and enable it to run at boot:
sudo systemctl start docker
sudo systemctl enable docker
Create a configuration file for imgproxy. The configuration file defines the source of the images and the allowed transformations.
Create the configuration file as /etc/imgproxy.conf
and add the following contents:
# imgproxy.conf
listener: ":8080"
source: "https://example.com"
cache:
type: "fs"
path: "/var/imgproxy/cache"
watermark:
url: "https://imgproxy.net/static/watermark.png"
opacity: 0.5
presets:
"thumbnail":
width: 200
height: 200
gravity: "noea"
enlarge: true
security:
allow_origin: "*"
allow_credentials: true
You can edit the configuration to suit your specific needs.
Finally, we can run the imgproxy container using the configuration file. Run the following command:
sudo docker run --restart=always --name=imgproxy -p 8080:8080 -v /etc/imgproxy.conf:/opt/imgproxy/conf/imgproxy.conf sorz/imgproxy
The sudo docker run
command runs the imgproxy container with the following options:
--restart=always
: automatically start the container when the server is rebooted--name=imgproxy
: name the container imgproxy
-p 8080:8080
: map the container port 8080 to the server port 8080-v /etc/imgproxy.conf:/opt/imgproxy/conf/imgproxy.conf
: mount the configuration file from /etc/imgproxy.conf
to the container default configuration filesorz/imgproxy
: specifies the imgproxy container image from Docker Hubimgproxy should now be running on the server. To test it, open your web browser and go to http://your-server-ip:8080
or http://your-domain-name:8080
.
The imgproxy server should return a JSON response that tells you that the server is running. You can now use imgproxy to resize your images on the fly.
Congratulations, you've successfully installed imgproxy on Fedora CoreOS Latest!
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!