How to Install Fork CMS on ECS

By Arslan Ud Din Shafiq, Alibaba Cloud Tech Share Author. Tech Share is Alibaba Cloud’s incentive program to encourage the sharing of technical knowledge and best practices within the cloud community.

Fork is an intuitive, user friendly and open source CMS. Fork uses the Symphony framework and provides various tools for its users to build, monitor, and update websites. You easily can integrate it with web analytics tools to analyze user behavior on your website and perform search engine optimization.

In this tutorial, we will be installing and setting up Fork CMS on an Alibaba Cloud Elastic Compute Service (ECS) with Ubuntu 16.04 installed.


  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 — $1200 worth in Alibaba Cloud credits for your new account. If you don’t know about how to setup your ECS instance, you can refer to this tutorial or quick-start guide. Your ECS instance must have at least 1GB RAM and 1 Core processor.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server’s hostname and create user with root privileges.

Setting Up Your Server

Before proceeding with installation of any kind of package, use the following command to update your Ubuntu system. To execute this command, remember to login from non-root user with sudo privileges.

You will need to install unzip which will be used to unzip the compressed zip folder.

You will also need to download Fork CMS from GitHub, so you will have to install Git.

Install PHP

Fork CMS requires installation of PHP 7.1 or newer version of PHP. In this tutorial, you will install PHP 7.2. To install PHP 7.2, execute the following steps.

First, you will need to install python software properties and software properties common.

Add the repository for newer versions of PHP.

Update the system to refresh the available repositories.

Install PHP 7.2 by executing the following command.

Fork CMS requires the following PHP extensions:

  1. php7.2-cli
  2. php7.2-fpm
  3. php7.2-common
  4. php7.2-curl
  5. php7.2-mbstring
  6. php7.2-gd
  7. php7.2-intl
  8. php7.2-mysql
  9. php7.2-xml
  10. php7.2-json

To install the above extensions of PHP, execute the following command.

When you have installed the above extensions, apache2 will be installed automatically. You don’t need to install apache explicitly.

To check PHP installation, you can execute the following command to check your installed PHP version.

Install MariaDB

Fork CMS supports MySQL. In this tutorial, you will use a MariaDB database. By default, the Ubuntu repository has an older version of MariaDB. To use new version of MariaDB, you will need to add MariaDB repository to your Ubuntu system. To do so, follow the steps below.

Verify the keys by executing the following command.

Add the repository using the following command.

Update the system.

Install MariaDB using the following command.

Start and enable the MariaDB so that after reboot, MariaDB can start automatically.

Run the following command to enhance security of MariaDB and set a password for the root user.

Connect to the MySQL shell as root user using the command below and enter your password.

Execute the following MySQL queries in your MariaDB server.

Install Composer

Fork CMS uses Symphony framework, so it requires installation of Composer. To install and setup composer, execute the following demands.

Install Fork CMS

To install Fork CMS, you will need to perform the following steps.

Navigate to /var/www/ using the command.

Download the latest stable release of Fork CMS using the command below.

Provide ownership of /var/www/ to www-data so that apache server can access the required files.

Configure Database

To setup database, execute the following command. It will open a file using nano editor in which you will need to update username, password, database name, host and port.

Configure Apache Server

Create virtual host configuration file for Fork CMS. Execute the following command, a file will be opened in nano text editor.

Copy and Fork CMS the following code and save the file.

Execute the command below to disable default site.

You will need to enable the newly created virtual host.

You will need to enable rewrite mod. You can do so by editing configuration file in apache2 directory or you can simply execute the command below.

You will need to enable SSL engine. You can do so by editing configuration file in apache2 directory or you can simply execute the command below.

You will have to restart apache server to apply the changes and load the settings by executing command below.

You can access Fork CMS via your domain name or ECS IP address. In my case, I have accessed via . Remember to prefix www in URL. You will see the following screen.

Install SSL Certificate

To install SSL certificate using Let’s Encrypt, you will use Certbot. To do so, execute the following steps.

Update the package using command.

To install software-properties-common, execute the command below.

Add the certbot repository by using command below.

Update the package to load the added certbot repository using command.

Stop apache before issuance of SSL certificate.

Install python-certbot-apache using the command below.

Execute the following command to get Let’s Encrypt SSL issued.

Select option 2 to redirect the link to https and update virtual host settings for SSL.

Restart apache server.

You will have to edit .htaccess file to activate rules for SSL. To do so, execute the command below.

Now remove # sign as shown in the following code.

You can access your website using https protocol https://www.your_domain_name.tld

Set Up Firewalls and Ports

If you have activated firewalls, you will have to define a rule in Alibaba Cloud security group for your cloud server to add exception for port 80/tcp and 443/tcp. You can enable these ports while creating ECS instance, but in case if you have forgotten to unblock these ports, you can follow the procedure in this guide:

Configuring Fork CMS

Access Fork CMS via domain name or ECS IP address. You will see the following screen.

Hit Next. You will see the following screen.

Hit Next. You will see the database configuration screen. Add the details about database.

Set email and password for admin panel and hit Finish Installation.

You will be redirected to the following screen.

You can access admin panel by prefixing /private to the link.

After login, you will see the following dashboard.

After accessing home page, you will see the following screen.

Congratulations! You go, you have successfully installed and configured Fork CMS on your Alibaba Cloud Elastic Compute Service (ECS) server.


Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store