Install Chevereto on Ubuntu 20.04 VPS with Virtualmin and Nginx

Chevereto enables you to build your own image hosting website on your own server. It packs powerful features to take control of your image sharing activity. We’ll see how to install Chevereto on VPS with Virtualmin and Nginx with this tutorial.

This self-hosted Photobucket alternative has a free version and a paid version. Free version is 6 months behind updates and doesn’t have some features like external storages and multi-server support. But it still enables you to host and share your images in a fancy way.

Folks at Chevereto offers free installation service if you have cPanel on your server. This tutorial is for people who don’t want to spend on a cPanel license. We’ll use Virtualmin control panel and nginx as web server. This will sure boost speed of your Chevereto and images. Additionally, we will use PHP 7 and MySQL to setup a LEMP hosting environment for Chevereto.

freelancer to install chevereto Not a tech guy? Rather have a freelancer install Chevereto for you? Who’s better than the guy who wrote this tutorial!
Hire me and have your Chevereto ready within 24 hours!
Get Chevereto Installed

Requirements to Install Chevereto on VPS

You’ll need a VPS obviously. A $10/Mo VPS from my recommended VPS providers is more than enough to handle Chevereto. This tutorial is only tested on Ubuntu. So make sure select Ubuntu as OS. Then you need to configure your VPS with Virtualmin and Nginx. Doing so will build LEMP environment on your VPS. Finally add your Chevereto domain to Virtualmin. Once you complete those steps, you can follow below instructions to install Chevereto on VPS.

Download Chevereto to the Server

Chevereto has free and paid versions of its software. Free version is hosted on Github. And you need to purchase paid version to be able to download it.

Download Chevereto free version to the Server

You can download Chevereto free directly to the server using Git. It’s the fastest way. Login to server using the username created when adding your domain to VPS and execute following command to navigate document root of your domain.

cd $HOME/public_html

Then execute following commands to download Chevereto free version from Github repository.

git init
git remote add origin https://github.com/Chevereto/Chevereto-Free.git
git pull origin master
Upload Chevereto paid version to the Server

You can’t download paid version to the server directly. You’ll have to save it on your PC and upload everything inside chevereto directory to the server using sFTP or Virtualmin file manager.

Add nginx Rewrite Rules for Chevereto

Chevereto needs special rewrite rules for pretty links and image hotlinks to work. We’ll use official nginx rewrite rules provided by the author.

You must use root account of your VPS to add these rules. So login to root account and use following command to open nginx configuration file for your domain. Change the example.com to your domain name.

nano /etc/nginx/sites-available/example.com.conf

Now search for following line within the file using Ctrl+W keys.

fastcgi_param HTTPS $https;

Paste these rules BELOW that line,

#Chevereto: Disable access to sensitive files
location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ {
    deny all;
}
#Chevereto: CORS headers
location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
    add_header Access-Control-Allow-Origin "*";
}
#Chevereto: Upload path for image content only and set 404 replacement
location ^~ /images/ {
    location ~* (jpe?g|png|gif) {
        log_not_found off;
        error_page 404 /content/images/system/default/404.gif;
    }
    return 403;
}
#Chevereto: Pretty URLs
location / {
    index index.php;
    try_files $uri $uri/ /index.php?$query_string;
}

Hit Ctrl+X to close the file. Finally restart nginx,

service nginx restart

Install Chevereto on VPS

Your server is now ready to host Chevereto image hosting script. Open your domain in a browser and you’ll be redirected to Chevereto web installer. It’ll ask you for MySQL credentials which you can obtain from Virtualmin.

Type localhost in the Database host field and fill in the MySQL credentials. Change Database table prefix if needed and click Continue. Finish installer in the next step.

Success!! you’ve installed Chevereto on VPS with Virtualmin and nginx. Now start uploading and sharing your images.

Tharindu

Hey!! I'm Tharindu. I'm from Sri Lanka. I'm a part time freelancer and this is my blog where I write about everything I think might be useful to readers. If you read a tutorial here and want to hire me, contact me here.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button