How to Install Thumbor on MXLinux Latest

Thumbor is a Python-based open-source photo thumbnailing service which is used by various websites for processing and serving images. In this tutorial, we will guide you on how to install Thumbor on MXLinux.

Prerequisites

The following prerequisites are required before proceeding.

Step 1: Update the system

First, we need to update the system to ensure that all packages are up to date.

sudo apt update 
sudo apt upgrade

Step 2: Install Dependencies

Thumbor requires certain dependencies to function properly. In a terminal, type the following command to install these dependencies.

sudo apt install python3-dev python3-pip libjpeg-dev libpq-dev libpng-dev libtiff-dev libwebp-dev libxml2-dev libxslt1-dev libyaml-dev libffi-dev libssl-dev

Step 3: Install Thumbor

You can install Thumbor using pip, which is the standard package installer for Python.

pip3 install thumbor

Step 4: Configure Thumbor

By default, Thumbor will listen on localhost:8000. You can configure Thumbor to listen on a different port or interface by creating a configuration file.

Create a new directory for the configuration file:

sudo mkdir /etc/thumbor

Create the configuration file:

sudo nano /etc/thumbor/thumbor.conf

Add the following configuration to the file:

[thumbor]
security_key = INSERT_YOUR_KEY_HERE

Make sure to replace INSERT_YOUR_KEY_HERE with a secret key that you will use to sign URLs. You can generate a secret key using the Python secrets module.

import secrets
secrets.token_hex(32)

For more information on the available configuration options, please visit the official documentation.

Step 5: Start the Thumbor Service

Start the Thumbor service with the following command:

thumbor --conf /etc/thumbor/thumbor.conf

You should see the following output:

INFO - thumbor.service - running on 0.0.0.0:8000
INFO - thumbor.service - using engine module thumbor.engines.pil
INFO - thumbor.security - loaded Crypto security handler

Step 6: Access Thumbor

You can now access Thumbor by visiting http://localhost:8000.

Conclusion

In this tutorial, we have shown you how to install Thumbor on MXLinux. You can now use Thumbor to serve images on your website.

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!