How to Install WonderCMS with Nginx on Debian 9

WonderCMS is a free and open supply flat file CMS, aimed to be extraordinarily small, mild and easy. It is constructed with PHP, jQuery, HTML/CSS and developed since 2008. No preliminary configuration required. The set up course of is fairly easy – unzip and add 5 information. All information could be simply moved, backed up and restored by copy/pasting all information to a different location. Shifting them to a different host doesn’t require any re-configuration. WonderCMS additionally would not require a standard/relational database like MySQL. The flat file know-how permits WonderCMS to save lots of all information to a textual content file (flat file) referred to as database.js which is structured in JSON format. On this tutorial, we are going to undergo the WonderCMS set up and setup on the Debian 9 system by utilizing Nginx as an online server, and optionally you may safe the transport layer by utilizing consumer and Let’s Encrypt certificates authority so as to add SSL help.


Necessities for putting in and working WonderCMS are:

  • PHP model 7.1 or higher with the curl, mbstring and zip extensions.
  • Web server (Apache with mod_rewrite module enabled, Nginx, IIS).


  • An Debian 9 working system.
  • A non-root person with sudo privileges.

Preliminary steps

Examine your Debian model:

lsb_release -ds
# Debian GNU/Linux 9.9 (stretch)

Arrange the timezone:

sudo dpkg-reconfigure tzdata

Replace your working system packages (software program). This is a vital first step as a result of it ensures you could have the most recent updates and safety fixes to your working system’s default software program packages:

sudo apt replace && sudo apt improve -y

Set up some important packages which might be mandatory for fundamental administration of the Debian working system:

sudo apt set up -y curl wget vim git unzip socat bash-completion apt-transport-https

Step 1 – Set up PHP and mandatory PHP extensions

Add third-party repo for PHP 7.2 set up:

sudo apt set up apt-transport-https lsb-release ca-certificates
wget -O /and many others/apt/trusted.gpg.d/php.gpg
echo "deb $(lsb_release -sc) main" > /and many others/apt/sources.listing.d/php.listing
sudo apt replace

Set up PHP, in addition to the required PHP extensions:

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

To indicate PHP compiled in modules, you may run:

php -m

. . .
. . .

Examine the PHP model:

php --version

# PHP (cli) (constructed: Apr 18 2019 14:12:38) ( NTS )
# Copyright (c) 1997-2018 The PHP Group
# Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Applied sciences
# with Zend OPcache v7.2.10.debian.18.04.1, Copyright (c) 1999-2018, by Zend Applied sciences

PHP-FPM service is mechanically began and enabled on reboot on Debian 9 system, so there is no such thing as a want to begin and allow it manually. We are able to transfer on to the subsequent step, which is the SSL setup.

Step 2 – Set up consumer and procure Let’s Encrypt certificates ( elective )

Securing your discussion board with HTTPS will not be mandatory, however it’s a good follow to safe your website visitors. With the intention to acquire a TLS certificates from Let’s Encrypt we are going to use consumer. is a pure UNIX shell software program for acquiring TLS certificates from Let’s Encrypt with zero dependencies.

Obtain and set up

sudo su - root
git clone
./ --install --accountemail [email protected]
supply ~/.bashrc
cd ~

Examine model: --version
# v2.8.0

Get hold of RSA and ECC/ECDSA certificates to your area/hostname:

# RSA 2048 --issue --standalone -d --keylength 2048
# ECDSA --issue --standalone -d --keylength ec-256

If you need pretend certificates for testing you may add --staging flag to the above instructions.

After working the above instructions, your certificates and keys will probably be in:

  • For RSA: /residence/username/ listing.
  • For ECC/ECDSA: /residence/username/instance.com_ecc listing.

To listing your issued certs you may run: --list

Create a listing to retailer your certs. We’ll use /and many others/letsencrypt listing.

mkdir -p /and many others/letsecnrypt/
sudo mkdir -p /and many others/letsencrypt/instance.com_ecc

Set up/copy certificates to /and many others/letsencrypt listing.

# RSA --install-cert -d --cert-file /and many others/letsencrypt/ --key-file /and many others/letsencrypt/ --fullchain-file /and many others/letsencrypt/ --reloadcmd "sudo systemctl reload nginx.service"
# ECC/ECDSA --install-cert -d --ecc --cert-file /and many others/letsencrypt/instance.com_ecc/cert.pem --key-file /and many others/letsencrypt/instance.com_ecc/non-public.key --fullchain-file /and many others/letsencrypt/instance.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"

All of the certificates will probably be mechanically renewed each 60 days.

After acquiring certs exit from root person and return again to regular sudo person:


Step 3 – Set up and configure NGINX

WonderCMS can work fantastic with many fashionable internet server software program. On this tutorial, we chosen NGINX.

Set up NGINX:

sudo apt set up -y nginx

Examine the NGINX model:

sudo nginx -v
# nginx model: nginx/1.10.3

Subsequent, configure NGINX for WonderCMS. Run sudo vim /and many others/nginx/sites-available/wondercms.conf and add the next configuration:

server {
   hear 80;
   hear 443 ssl;

ssl_certificate /and many others/letsencrypt/;
ssl_certificate_key /and many others/letsencrypt/;
ssl_certificate /and many others/letsencrypt/instance.com_ecc/fullchain.cer;
ssl_certificate_key /and many others/letsencrypt/instance.com_ecc/;
server_name; root /var/www/wondercms; index index.php; location / { if (!-e $request_filename) { rewrite ^/(.+)$ /index.php?web page=$1 final; } } location ~ database.js { return 403; } location ~ .php(/|$) { embrace snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; } }

Activate the brand new wondercms.conf configuration by linking the file to the sites-enabled listing:

sudo ln -s /and many others/nginx/sites-available/wondercms.conf /and many others/nginx/sites-enabled/

Examine NGINX configuration for syntax errors:

sudo nginx -t

Reload NGINX service:

sudo systemctl reload nginx.service

Step 4 – Set up WonderCMS

Create a doc root listing for WonderCMS.

sudo mkdir -p /var/www/wondercms

Change possession of the /var/www/wondercms listing to [jour_username]:

sudo chown -R [your_username]:[your_username] /var/www/wondercms

Navigate to the doc root listing:

cd /var/www/wondercms

Obtain and unzip WonderCMS supply:


Transfer WonderCMS information to doc root listing.

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

Change possession of the /var/www/wondercms listing to www-data:

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

Open your website in an online browser and log in with default password admin and alter the default password afterward.

WonderCMS on Debian Linux



Please enter your comment!
Please enter your name here