How to Install Thumbor on Fedora CoreOS Latest
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.
Prerequisites
Before starting the installation process, make sure that you have the following:
- A server running Fedora CoreOS latest
- A root user or a user with sudo privileges
Step 1: Install Dependencies
Launch the terminal on your Fedora CoreOS server.
Update the system to the latest version by running the following command:
sudo dnf updateInstall the required dependencies for Thumbor by running the following command:
sudo dnf install python3 python3-devel libcurl-devel libjpeg-turbo-devel libpng-devel gifsicle
Step 2: Install Thumbor
Run the following command to install Thumbor:
sudo pip3 install thumborVerify that Thumbor has been installed successfully by running the following command:
thumbor --versionThis command will output the version of Thumbor installed on your server.
Step 3: Configure Thumbor
Create a Thumbor configuration file by running the following command:
sudo nano /etc/thumbor.confAdd 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-hereplaceholder 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/resultSet 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
Step 4: Start and Enable the Thumbor Service
Create a system unit file for Thumbor by running the following command:
sudo nano /etc/systemd/system/thumbor.serviceAdd 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.targetSave and exit the file.
Reload the system unit file by running the following command:
sudo systemctl daemon-reloadStart the Thumbor service by running the following command:
sudo systemctl start thumborEnable the Thumbor service to start automatically at boot time by running the following command:
sudo systemctl enable thumbor
Step 5: Test 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.