Ghost is a fully open source, hackable platform for building and running a modern online publication. It is a light-weight. It is fully customizable, with many themes available. Ghost user interface is very simple and straightforward making it great for beginners as well as advanced users.
This tutorial will walk you through how to install Ghost on Ubuntu.Requirements
In this tutorial we will be using Ubuntu 16.04, however, you should be able to use all our offered Ubuntu and Debian versions.
In Time4VPS you are able to install Ubuntu 16.04 template really easy and fast, only with few mouse clicks:
- Login to the Client Area;
- Select at the top of menu the "My Services > VPS" tab;
- Press the "Manage" button at the service table;
- Press the "Install OS" button;
- Choose Ubuntu 16.04 operating system, agree with warning and press "Continue";
- Wait for 5-10 minutes and refresh VPS management page.
First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get upgrade -y
Create a new user
It is important to choose a DIFFERENT username than ghost. Using ghost will cause issues with the ghost system.
Now, set permissions for the user:
usermod -aG sudo <user>
Switch to the created user:
There is at least few quite good ways to install Node.js on the server, so you are able to use any of them. However, if you do not have your own preferable way and do not want to configure it by yourself you can simply run these commands:
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash
sudo apt-get install -y nodejs
Note: If you got error "-bash: curl: command not found" you need to install curl. Run this command to do that:Install Nginx
apt-get install curl
Now you need to install and configure Nginx. First of all, if you have installed Apache, you need to stop it:
Now we can install Nginx:
sudo apt-get install nginx -y
Next, proceed with the MySQL installation:
sudo apt-get install mysql-server -y
Notice - during the installation set MySQL user with a password. It will be needed in the end.
Install Ghost-CLI for easier Ghost installation:
sudo npm install [email protected] -g
Create a webroot directory. We use ghost, but you can choose a different one:
sudo mkdir -p /var/www/ghost
Set the owner of the directory:
sudo chown <user>:<user> /var/www/ghost
Set the 755 permissions for the directory:
sudo chmod 775 /var/www/ghost
During the installation you will be requested to enter information about your site:
Blog URL - Website address (do not use IP)
MySQL hostname - localhost
MySQL user - root
MySQL password - the one you have set during MySQL installation
Ghost database name - any name, by default it is ghost_prod. If you use root log-in to MySQL system will create the database for you.
Set up MySQL Ghost user? - yes
Set up Nginx - yes
Set up SSL - yes
Set up systemd - yes
Start Ghost - yes
Now you have installed, configured, and ready to be used Ghost application on your server. Go to your domain.tld/ghost, set up login and other details and that's it, you are ready to blog!