How to install WonderCMS on Ubuntu 18.04

WonderCMS is a small and very fast open source CMS written in PHP. It is designed to work with flat files, which should be very small and light. A great advantage for many is that WonderCMS does not require a traditional database such as MySQL.

Verify Ubuntu Version

First you need to verify your version of Ubuntu. This can be done with the following command:

lsb_release -ds
# Ubuntu 18.04.1 LTS

Then create a new non-root user account with sudo access and switch to it

adduser alexmoure --gecos "Alex Moure"
usermod -aG sudo alexmoure
su - alexmoure

Important! Change the “Alex Moure” on your user name

Set the time zone

sudo dpkg-reconfigure tzdata

Make sure your system is up to date

sudo apt update && sudo apt upgrade -y

Install the necessary packages

sudo apt install -y zip unzip curl wget git

Install PHP

Install PHP and all necessary permissions

sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-curl php7.2-zip php7.2-mbstring

Check the version

php --version
# PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb  8 2019 14:54:22) ( NTS )

Install nginx

You can install Nginx web server using this command:

sudo apt install -y nginx

Check version

sudo nginx -v
# nginx version: nginx/1.14.0 (Ubuntu)

Run sudo vim /etc/nginx/sites-available/wondercms.conf and configure Nginx for WonderCMS

server {

  listen 80;

  server_name example.com;
  root /var/www/wondercms;

  index index.php;


  location / {
    if (!-e $request_filename) {
      rewrite ^/(.+)$ /index.php?page=$1 last;
    }
  }
  location ~ database.js {
    return 403;
  }

  location ~ \.php(/|$) {
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
  }

}

Save the file and exit

Activate the new wondercms.conf configuration by linking the file to the sites-enabled directory

sudo ln -s /etc/nginx/sites-available/wondercms.conf /etc/nginx/sites-enabled/

Check the configuration

sudo nginx -t

Restart Nginx

sudo systemctl reload nginx.service

Install WonderCMS

For the beginning you need to create the root directory of the document

sudo mkdir -p /var/www/wondercms

Change the owner of the /var/www/wondercms directory to alexmoure

sudo chown -R alexmoure:alexmoure /var/www/wondercms

Go to the root folder of the document

cd /var/www/wondercms

Download and unzip WonderCMS

wget https://github.com/robiso/wondercms/releases/download/2.6.0/WonderCMS-2.6.0.zip
unzip WonderCMS-2.6.0.zip
rm WonderCMS-2.6.0.zip

Then you need to Move the WonderCMS files to the root directory of the document

mv wondercms/* . && mv  wondercms/.* .
rmdir wondercms

Change the owner of the /var/www/wondercmsĐĽ directory to www-data

sudo chown -R www-data:www-data /var/www/wondercms

Open your website in a web browser and log in with the default password, admin and then change the default password.

Was this article helpful?

Related Articles

Leave A Comment?