How to Install Thumbor on Arch Linux

Thumbor is an open-source tool used for image resizing, cropping, and flipping. It's designed to be fast and easy to use. In this tutorial, we will walk you through the process of installing Thumbor on Arch Linux.

Prerequisites

Before proceeding, make sure you have the following requirements:

Step 1: Install Dependencies

The first step towards installing Thumbor is to ensure that all its dependencies are installed on your system. Run the following commands to update your system and install the necessary packages:

sudo pacman -Syu
sudo pacman -S gcc git openssl python3

Step 2: Install Thumbor

Thumbor is written in Python and can be installed with pip. Run the following commands to install Thumbor and its dependencies:

sudo pacman -S python-pip
sudo pip install thumbor

Step 3: Configure Thumbor

Thumbor uses a configuration file, which specifies various parameters for its operation. You can either edit the default configuration file or create your own.

Create a new configuration file by copying the sample configuration file:

cp /usr/lib/python3.9/site-packages/thumbor/thumbor.conf.sample thumbor.conf

Edit the configuration file as per your requirements. Here are some important settings:

    # Listen to all incoming requests
    SERVER_NAME = '0.0.0.0'

    # Set the port number (default is 8888)
    PORT = 8000

    # Specify the maximum allowed image size (default is 0, which means unlimited)
    MAX_WIDTH = 0
    MAX_HEIGHT = 0

    # Enable security features (default is False)
    ENABLE_SECURITY = True

    # Specify security key for encrypted URL signatures (default is empty)
    SECURITY_KEY = 'your-security-key'

    # Set the location of the file storing image variations
    RESULT_STORAGE_FILE_STORAGE = 'thumbor.result_storage.file_storage'

    # Set the path for storing image variations (default is /var/thumbor/storage)
    RESULT_STORAGE_FILE_STORAGE_ROOT_PATH = '/var/thumbor/storage'

Save and close the configuration file.

Step 4: Run Thumbor

You can run Thumbor directly from the command line, as follows:

thumbor --conf thumbor.conf

Alternatively, you can create a systemd service file to start and stop Thumbor automatically at boot time. Run the following command to create the service file:

sudo nano /etc/systemd/system/thumbor.service

Add the following content to the file:

[Unit]
Description=Thumbor service
After=network.target

[Service]
Type=simple
User=thumbor
Group=thumbor
Restart=always
ExecStart=/usr/bin/thumbor --conf /etc/thumbor/thumbor.conf

[Install]
WantedBy=multi-user.target

Save and close the file.

Next, create a user and group for Thumbor:

sudo useradd -r -d /var/thumbor -s /bin/nologin thumbor
sudo chown -R thumbor:thumbor /var/thumbor

Now reload the systemd daemon and start Thumbor:

sudo systemctl daemon-reload
sudo systemctl enable thumbor.service
sudo systemctl start thumbor.service

Thumbor should now be up and running on your system. You can access the Thumbor web interface by visiting http://:8000/.

Conclusion

In this tutorial, we have walked you through the process of installing Thumbor on Arch Linux. We hope this guide has been helpful in getting Thumbor up and running on your system. Feel free to explore more features and configurations of Thumbor to suit your image-processing needs.

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!