Install Anchor CMS on a Debian 8 VPS

install-anchor-cms-on-a-debian-8-vpsIn this tutorial, we will explain how to install Anchor CMS on a Debian 8 VPS with MariaDB, PHP-FPM and Nginx. Anchor CMS is a modern lightweight open source CMS built on PHP. This guide should work on other Linux VPS systems as well but was tested and written for an Debian 8 VPS.

Login to your VPS via SSH

ssh user@vps

Update the system and install necessary packages

[user]$ sudo apt-get update && sudo apt-get -y upgrade
[user]$ sudo apt-get install wget software-properties-common

Install MariaDB 10.0

To install the latest MariaDB 10 version, run the following commands:

[user]$ sudo apt-key adv --recv-keys --keyserver 0xcbcb082a1bb943db
[user]$ sudo add-apt-repository 'deb jessie main'
[user]$ sudo apt-get update
[user]$ sudo apt-get install -y mariadb-server

When the installation is complete, run the following command to secure your installation:

[user]$ mysql_secure_installation

Next, we need to create a database for our Anchor installation.

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE anchor;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON anchor.* TO 'anchoruser'@'localhost' IDENTIFIED BY 'anchoruserpasswd';
MariaDB [(none)]> \q

Install Nginx

The latest version of Nginx, version 1.8 is not available via the default Debian repositories, so we will add the Dotdeb repository. Open the /etc/apt/sources.list file and append the following lines:

[user]$ sudo vim /etc/apt/sources.list
deb jessie all
deb-src jessie all

Fetch and install the GnuPG key:

[user]$ curl -sS | sudo apt-key add -

Update the system and install Nginx:

[user]$ sudo apt-get update
[user]$ sudo apt-get -y install nginx

Install PHP and required PHP modules

To install the latest stable version of PHP version 5.6 and all nessesary modules, run:

[user]$ sudo apt-get -y install php5-fpm php5-cli php5-gd php5-mysqlnd php5-curl php5-mcrypt

Download Anchor

Create a root directory

[user]$ mkdir -p ~/

Download the latest version of Anchor

[user]$ wget -O /tmp/

Unzip the Anchor archive

[user]$ unzip /tmp/ -d /tmp
[user]$ mv /tmp/anchor-cms-*/* ~/

PHP-FPM configuration

Create a new PHP-FPM pool for your user:

[user]$ sudo tee -a /etc/php5/fpm/pool.d/$(whoami).conf  << EOF
user = $(whoami)  
group = $(whoami)  
listen = /var/run/php5-fpm-$(whoami).sock  
listen.owner = $(whoami) = $(whoami)  
listen.mode = 0666  
pm = ondemand  
pm.max_children = 5  
pm.process_idle_timeout = 10s;  
pm.max_requests = 200  
chdir = /

Change the upload filesize limit:

[user]$ sudo cp /etc/php5/fpm/php.ini{,.backup}  
[user]$ sudo sed -i "s/^upload_max_filesize = .*/upload_max_filesize = 64M/" /etc/php5/fpm/php.ini

Restart PHP-FPM:

[user]$ sudo service php5-fpm restart

Nginx configuration

Create a new Nginx server block with the following content:

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer

Now just $43 .99

[user]$ sudo tee -a /etc/nginx/sites-available/  << EOF
server {
    listen 80;
    root $HOME/;
    index index.html index.php;

    access_log /var/log/nginx/;
    error_log /var/log/nginx/;

    location / {
        try_files \$uri \$uri/ /index.php;

    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
      access_log off;
      expires max;

    location ~ \.php\$ {
        fastcgi_pass unix:/var/run/php5-fpm-$(whoami).sock;
        fastcgi_split_path_info ^(.+\.php)(/.*)\$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        fastcgi_index index.php;

    location ~ /\.ht {
        deny all;

Activate the server block by creating a symbolic link :

[user]$ sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

Test the Nginx configuration and restart nginx:

[user]$ sudo nginx -t
[user]$ sudo service nginx restart

Install Anchor

Open your web browser, navigate to enter the following information:

  • Database Host: localhost
  • Database Name: anchor (the name of the database you previously created)
  • Username: anchoruser (the name of the MySQL user you previously created)
  • Password: anchoruserpasswd (the password of the MySQL user you previously created)

create an administrator account and click on the “Complete” button.

That’s it. You have successfully installed Anchor on your Debian 8 VPS. For more information about how to manage your Anchor installation, please refer to the Anchor website.

Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Leave a Comment