Hello, friends. Although the CMS market is dominated with an iron fist by WordPress, there are other solid alternatives. In this post, you will learn how to install Ghost CMS on Ubuntu 20.04.
Ghost CMS is a CMS intended for the creation of any website on the Internet. What makes it popular is that it has default tools to improve the profitability of the website.
It has many unique themes so you can get an almost unique design for your site. Also, install them with just a few clicks and no complex configurations.
It is widely used worldwide and is one of the most solid alternatives to WordPress. So, you must know how to install it if you are looking for the ideal CMS for you.
Let’s get started.
Before performing any operation on the server, it is recommended that you know that you need a valid A domain pointing to your server. Moreover, we will do the tutorial on a clean Ubuntu installation.
So, Nginx and Apache are the best web servers out there. But in this case, we will opt for Nginx to take advantage of the default configuration of Ghost CMS.
In a Terminal session, update first the server
sudo apt update sudo apt upgrade
Next install it:
sudo apt install nginx Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 libxslt1.1 nginx-common nginx-core Suggested packages: libgd-tools fcgiwrap nginx-doc ssl-cert The following NEW packages will be installed: fontconfig-config fonts-dejavu-core libfontconfig1 libgd3 libjbig0 libjpeg-turbo8 libjpeg8 libnginx-mod-http-image-filter libnginx-mod-http-xslt-filter libnginx-mod-mail libnginx-mod-stream libtiff5 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 libxslt1.1 nginx nginx-common nginx-core 0 upgraded, 23 newly installed, 0 to remove and 19 not upgraded. Need to get 3,334 kB of archives. After this operation, 11.6 MB of additional disk space will be used. Do you want to continue? [Y/n]
And now proceed to enable it to start with the system.
sudo systemctl enable nginx Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd/systemd-sysv-install enable nginx
Next, check the status of the Nginx service.
sudo systemctl status nginx ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-07-30 18:00:13 CEST; 23s ago Docs: man:nginx(8) Main PID: 1796 (nginx) Tasks: 3 (limit: 2286) Memory: 5.0M CGroup: /system.slice/nginx.service ├─1796 nginx: master process /usr/sbin/nginx -g daemon on; master_process on; ├─1797 nginx: worker process └─1798 nginx: worker process Jul 30 18:00:13 osradar systemd: Starting A high performance web server and a reverse proxy server... Jul 30 18:00:13 osradar systemd: Started A high performance web server and a reverse proxy server.
The next step is to install MariaDB which you can do from the official repositories, or if you want to get a newer version you can do it by installing MariaDB 10.5 on Ubuntu 20.04.
In either case, you have to run the
mysql_secure_installation script to assign a root key and other settings.
After that, access the MariaDB shell to create the database and the new user that has permissions on it.
sudo mysql -u root -p CREATE DATABASE ghostdb; GRANT ALL PRIVILEGES ON ghostdb.* TO 'user'@'localhost' IDENTIFIED BY 'password'; FLUSH PRIVILEGES; exit;
You can assign a different database name, user name, and password.
The best way to install Ghost is through
ghost-cli a tool created by the developers to ease Ghost administration. So, this tool is built with NodeJS so we have to install it.
So, add the repository of version 14.x
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash
Then, install NodeJS along with other useful and recommended packages.
sudo apt install nodejs gcc g++ make
And proceed to install the tool as follows:
sudo npm install ghost-cli@latest -g
Now create the folder where we will install ghost in the path
sudo mkdir -p /var/www/ghost/
Make your user the owner of the folder and assign appropriate permissions to it.
sudo chown -R $USER:$USER /var/www/ghost/ sudo chmod 775 /var/www/ghost
Now go to the folder and from there perform the installation.
cd /var/www/ghost/ ghost install
And during the installation, you will have to answer some site configuration questions.
? Enter your blog URL: https://[your-domain] ? Enter your MySQL hostname: localhost ? Enter your MySQL username: user ? Enter your MySQL password: [hidden] ? Enter your Ghost database name: ghostdb ? Configuring Ghost ? Setting up instance ? Do you wish to set up Nginx? Yes ? Do you wish to set up Systemd? Yes ? Do you want to start Ghost? (Y/n) Y
When finished, you can access your website and start working. Enjoy it.
The installation of Ghost CMS is easy for all the potential it has. With it, you will be able to deploy a professional website quickly.
I hope you enjoyed it.