Steps to Install the Image Hosting Tool Chevereto on Synology via Docker

Steps to Install the Image Hosting Tool Chevereto on Synology via Docker
Steps to Install the Image Hosting Tool Chevereto on Synology via Docker
With Docker built into newer versions of Synology DSM, the NAS becomes much more powerful, and many common applications can now be installed through Docker. Given the various limitations of public image hosting services, it is very useful to build a private image hosting platform on Synology. Chevereto is a PHP-based open-source image hosting tool that is well suited for this scenario.
Environment Preparation
- Database: The Docker version of Chevereto requires a MySQL-compatible database. You can either install a Docker version of MySQL or use Synology's official MariaDB package. This guide uses MariaDB 10 from Synology Package Center as an example. In MariaDB, create a database named
chevereto, and create a user with permission to operate on that database, also namedchevereto(the database name and username do not have to bechevereto; you can change them as you like). - Image file: In Synology's Docker application, go to the Registry, search for
cheveretoin the top search bar, and several versions will appear. This guide uses the highly ratednmtan/cheveretoimage. - Data directory: To make uploaded images easier to store and manage, open File Station, locate the
Dockerdirectory, and create a new folder namedchevereto. This will be used later as the external storage directory.
Configure and Create the Container
After downloading the image, you will see the nmtan/chevereto image under the Image section in Synology Docker. Double-click the image to install it.
- Set the container name as desired.
- Configure the memory limit according to your actual needs.
- Click Advanced Settings.
Volume Mapping
Under the Volume section, click Add Folder, select the chevereto folder created earlier, and set the mount path to:
/var/www/html/images
This maps the images folder inside the container to an external directory on Synology.
Port Settings
Set the local port to 10000 (you may change this as needed; this is only an example), and keep the container port as the default 80.
Environment Variables
In the environment settings, configure the following database parameters for Chevereto:
CHEVERETO_DB_HOST: Database host address. Default isdb; see details below.CHEVERETO_DB_USERNAME: Database username. Default ischevereto.CHEVERETO_DB_PASSWORD: Database password. Use your actual configured password.CHEVERETO_DB_NAME: Database name. Default ischevereto.CHEVERETO_DB_PREFIX: Database table prefix. Default ischv_; no need to change it.CHEVERETO_DB_PORT: Database port. Default is3306, but MariaDB 10 on Synology uses3307by default, so this must be changed.
Important Notes About Database Connectivity
Because Chevereto is installed inside Docker, while MariaDB is installed on the host machine (the Synology NAS), using the default db value in Chevereto will not work for database access. You need to change db to the domain name or IP address of the Synology NAS. You can also use Docker's internal address.
To find it:
- Log in to Synology via SSH.
- Run the
ifconfigcommand. - Check the IP address beginning with
docker, which is usually172.17.0.1.
On the MariaDB side, since Chevereto is running inside Docker, it is not considered localhost. Therefore, you need to grant the chevereto user access from the Docker IP range or from %, so that Chevereto has permission to operate on the database.
Install and Configure Chevereto
If everything above has been configured correctly, after starting the container you should be able to open the Chevereto installation page in your browser at:
http://your-synology-domain:10000
Enter the administrator username, password, and other required information to begin the installation. Once installation is complete, Chevereto can be used just like a normal image hosting website.
After installation, you should still adjust some site settings. The configuration menu is located in the Admin Dashboard. Note that Chevereto's settings are accessed from the drop-down menu to the right of the Settings button.
In general, you may want to:
- Disable guest image uploads in the upload settings.
- Configure an SMTP-enabled email address in the email settings, so the site can send notifications and newly registered users can receive confirmation emails.
- Adjust other settings as needed according to the official documentation.
Remove the 2 MB Upload Limit and Adjust Content Limits
Due to PHP's default settings, the default upload size limit in Chevereto is only 2 MB, and the memory limit is 256 MB, which is far from enough for a modern image hosting service. These limits should be increased.
Steps
- Log in to Synology via SSH.
- Run
sudo -iand enter your password to switch to therootuser.- For security reasons, it is generally better to disable direct use of the default
rootaccount on Synology, use another admin-capable account for daily operations, and only switch with the above command when necessary.
- For security reasons, it is generally better to disable direct use of the default
- Run
docker ps -ato list running containers. - Find the
nmtan/cheveretocontainer and note its container ID (here we assume it is327c9776e0d3).
Copy the Configuration File Out of the Container
docker cp 327c9776e0d3:/var/www/html/.htaccess /volume1/docker/
Edit the .htaccess File
nano /volume1/docker/.htaccess
Add the following content at the end of the file:
# Increase upload file size limits
php_value post_max_size 64M
php_value upload_max_filesize 64M
php_value max_execution_time 300
php_value memory_limit 1024M
You may adjust these values based on your own requirements.
Copy the Modified File Back Into the Container
docker cp /volume1/docker/.htaccess 327c9776e0d3:/var/www/html/
Then restart the container, and the corresponding PHP limits should reflect the new values.
In Chevereto's own configuration, you can also adjust the allowed upload file size accordingly.


