Thumbor is an open-source photo thumbnail service that allows you to crop and resize images on the fly. In this tutorial, we will guide you through the process of installing Thumbor on Fedora CoreOS latest.
Before starting the installation process, make sure that you have the following:
Launch the terminal on your Fedora CoreOS server.
Update the system to the latest version by running the following command:
sudo dnf update
Install the required dependencies for Thumbor by running the following command:
sudo dnf install python3 python3-devel libcurl-devel libjpeg-turbo-devel libpng-devel gifsicle
Run the following command to install Thumbor:
sudo pip3 install thumbor
Verify that Thumbor has been installed successfully by running the following command:
thumbor --version
This command will output the version of Thumbor installed on your server.
Create a Thumbor configuration file by running the following command:
sudo nano /etc/thumbor.conf
Add the following contents to the file:
# The address to listen on.
SERVER_NAME = '0.0.0.0'
# Enable unsafe URLS for development environments.
ALLOW_UNSAFE_URL = True
# Set the path to the file storage.
FILE_STORAGE_ROOT_PATH = '/var/lib/thumbor/storage'
# Set the path to the result storage.
RESULT_STORAGE_ROOT_PATH = '/var/lib/thumbor/result'
# Set the path to the loader.
LOADER = 'thumbor.loaders.http_loader'
# Set the maximum parallelism for fetchers.
FETCHER_MAX_CLIENTS = 10
# Set the maximum simultaneous number of requests to image processor.
MAX_WIDTH = 0
MAX_HEIGHT = 0
QUALITY = 100
MAX_PIXELS = 0
# Set the maximum request size in bytes.
MAX_SOURCE_SIZE = 0
# Set the allowed sources for images.
ALLOWED_SOURCES = ['.*']
# Set the security key.
SECURITY_KEY = 'your-security-key-here'
Note: Replace the your-security-key-here
placeholder with your own security key.
Save and exit the file.
Create the required directories for Thumbor by running the following commands:
sudo mkdir /var/lib/thumbor
sudo mkdir /var/lib/thumbor/storage
sudo mkdir /var/lib/thumbor/result
Set the ownership and permissions for the directories by running the following commands:
sudo chown -R thumbor:thumbor /var/lib/thumbor
sudo chmod -R 777 /var/lib/thumbor
Create a system unit file for Thumbor by running the following command:
sudo nano /etc/systemd/system/thumbor.service
Add the following contents to the file:
[Unit]
Description=Thumbor image service
After=network.target
[Service]
User=thumbor
Group=thumbor
Environment="CONFIG_FILE=/etc/thumbor.conf"
ExecStart=/usr/local/bin/thumbor
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
[Install]
WantedBy=multi-user.target
Save and exit the file.
Reload the system unit file by running the following command:
sudo systemctl daemon-reload
Start the Thumbor service by running the following command:
sudo systemctl start thumbor
Enable the Thumbor service to start automatically at boot time by running the following command:
sudo systemctl enable thumbor
Open your web browser and navigate to the following URL:
http://<server-ip>:8888/unsafe/400x400/<image-url>
Note: Replace the <server-ip>
and <image-url>
placeholders with the IP address of your server and the URL of the image you want to resize, respectively.
If Thumbor is running successfully, you should see the resized image in your web browser.
Congratulations! You have successfully installed and configured Thumbor 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!