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:

Step 1: Install Dependencies

  1. Launch the terminal on your Fedora CoreOS server.

  2. Update the system to the latest version by running the following command:

    sudo dnf update
    
  3. 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
    

Step 2: Install Thumbor

  1. Run the following command to install Thumbor:

    sudo pip3 install thumbor
    
  2. 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.

Step 3: Configure Thumbor

  1. Create a Thumbor configuration file by running the following command:

    sudo nano /etc/thumbor.conf
    
  2. 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.

  3. Save and exit the file.

  4. 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
    
  5. 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
    

Step 4: Start and Enable the Thumbor Service

  1. Create a system unit file for Thumbor by running the following command:

    sudo nano /etc/systemd/system/thumbor.service
    
  2. 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
    
  3. Save and exit the file.

  4. Reload the system unit file by running the following command:

    sudo systemctl daemon-reload
    
  5. Start the Thumbor service by running the following command:

    sudo systemctl start thumbor
    
  6. Enable the Thumbor service to start automatically at boot time by running the following command:

    sudo systemctl enable thumbor
    

Step 5: Test Thumbor

  1. 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.

  2. 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!