Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Register

[Ubuntu] How to Install Ghost

LawrenceLawrence Member
edited May 2020 in Web Applications


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.


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:
  1. Login to the Client Area;
  2. Select at the top of menu the "My Services > VPS" tab;
  3. Press the "Manage" button at the service table;
  4. Press the "Install OS" button;
  5. Choose Ubuntu 16.04 operating system, agree with warning and press "Continue";
  6. Wait for 5-10 minutes and refresh VPS management page.

Updating System
First things first. Like always, first of all, we recommend to update and upgrade your server.
apt-get update
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.

adduser <user>

Now, set permissions for the user:

usermod -aG sudo <user>

Switch to the created user:

su <user>

Installing Node.js

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 | 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:
apt-get install curl

Install Nginx
Now you need to install and configure Nginx. First of all, if you have installed Apache, you need to stop it:
/etc/init.d/apache2 stop
Now we can install Nginx:
sudo apt-get install nginx -y

Install MySQL
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
Install Ghost-CLI for easier Ghost installation:
sudo npm install [email protected] -g

Installing Ghost
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
Install Ghost:
cd /var/www/ghost
ghost install

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!

Sign In or Register to comment.

Learn how to install a web and database server, email, FTP client or other applications. Discover and share information on server security or optimization recommendations.
Feel free to join our constantly expanding community, participate in discussions, strengthen your knowledge on Linux and Windows server management!
© 2013 - 2022 Time4VPS. All rights reserved.

Get In Touch