Install Ghost on Ubuntu 16.04

Im Durchschnitt wird dieses Tutorial Install Ghost on Ubuntu 16.04 mit 5 bewertet, wobei 1.0 die schlechteste und 5.0 die beste Bewertung ist. Es haben insgesamt 465 Besucher eine Bewertung abgegeben.

Install Ghost on Ubuntu 16.04

Node.js Ubuntu

Today we show you how to install the Ghost Blogging platform on Ubuntu 16.04

The professional publishing platform Ghost is in many ways a special blogging tool. Ghost is based on Node.js and was written entirely in JavaScript. In addition, Ghost is open-source software and acts as a non-profit organization. Especially developers get their money’s worth with Ghost and get full control over functionalities, themes and API integration.

In this tutorial we install Ghost under the officially recommended application stack for Ghost production. The recommended and supported stack of Ghost includes

– Ubuntu 16.04 LTS
– MySQL
– NGINX (minimum of 1.9.5 for SSL)
– Systemd
– Node v6 installed via NodeSource
– At least 1GB memory (swap can be used)
– A non-root user for running ghost commands

Preparations

As a prerequisite for the tutorial you need a VPS with Ubuntu 16.04. We simply created a gridscale cloud server with Ubuntu 16.04 LTS Template in a few clicks. In our tutorial How to gridscale we show you how to do this.

Before you can install the Ghost-CLI (Command-Line Interface) on your server, some preparations have to be made. You should also protect your server with a firewall. You can learn more about this in the tutorial Installing UFW on Ubuntu 16.04.

Create a new user

The Ghost installation should not be done under root. Connect to your server via ssh and create a new Linux system user:

 adduser [yourname]

Important: It is not a good idea to call your new user ghost – when you install the Ghost CLI later, a default user named ghost will already be created. This user is for managing your blog.

So that you don’t have to switch between root and your new user every time you run administrative commands, we give the user super-user rights. So you can execute commands that require super-user rights simply with sudo (superuser do):

usermod -aG sudo [deinname]

Afterwards you change to your new user:

su - [deinname]

Update Packages

The next step is to update and upgrade your package lists:

sudo apt-get update
sudo apt-get upgrade

Additionally we need the package build-essential:

sudo apt-get install build-essential

Install NGINX

sudo apt-get install nginx

Enable HTTP/HTTPS

If you have secured your system with the firewall UFW as in the tutorial linked above, you have to enable HTTP and HTTPS connections for NGINX:

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Install MySQL

sudo apt-get install mysql-server

The default database recommended by Ghost is MySQL. If you prefer to work with Sqlite3 instead, you can save yourself this step.

Important: Always create a root password! During the installation of MySQL you will be asked for a root password, it is absolutely necessary to assign this root password. Otherwise your Ghost-CLI can not connect to the MySQL database later.

Install Node.js

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash

and last but not least you install Node.js:

sudo apt-get install -y nodejs

Important: In case Node.js was already installed, check if Node.js was installed system-wide under: /usr/bin/node or /usr/local/bin/node. To do this, execute which node.

Furthermore, problems occur if Node.js was installed with nvm. In this case it is recommended to uninstall nvm and all node versions installed with nvm.

Install Ghost-CLI

After you have installed all the necessary tools of the application stack on your system, you can install the Ghost CLI:

sudo npm install -g ghost-cli@latest

Install Ghost

In the last step we install Ghost via the Ghost CLI.

Important: Do not install Ghost under /root or /home/{user}, otherwise problems with your Ghost setup will occur.

Instead, Ghost should only be installed in the /var/www/{folder} directory. Of course, Ghost is a good choice as a folder name, isn’t it?

Create a new directory for Ghost:

sudo mkdir -p /var/www/ghost

The folder must belong to your Linux system user, assign ownership rights to your newly created user:

sudo chown [youruser]:[youruser] /var/www/ghost

And change into your new directory:

cd /var/www/ghost/

Here you can now install Ghost conveniently via the Ghost CLI:

ghost install

Ghost configuration

During your installation, Ghost asks you a few questions:

Enter your blog URL: Your IP or domain address
Enter your MySQL hostname: localhost
Enter your MySQL username: root
Enter your MySQL password: your specified root password
Enter your Ghost database name: Default or own Ghost database name

Installing Ghost via the Ghost CLI covers the minimum configuration necessary to access your Ghost blog. The configuration of your ghost blog is managed by nconf. Further settings for your Ghost-Blog have to be done in the JSON file config.production.json, you can find it under:

/var/www/ghost

Call Ghost

Once the installation is complete, you can access your Ghost Blog from the IP address or domain in your browser.

Ghost install Welcome Screen

About:

http://[you-ip-or-domain]/ghost/

you will be shown the welcome screen, here you can create your new Ghost-Blog account.

Afterwards you can log in with your new account:

http://[deine-ip-oder-domain]/ghost/signin

Conclusion

With your new Ghost Blog, you’re ready for a new blogging experience and you can concentrate fully on writing. Well almost 😉 a few things are still to be done of course. Next time, you should take care of the mail configuration and secure your blog with SSL.

You can find more information in the Ghost Documentation:

Ghost Mail Configuration

Ghost SSL Setup

If you liked our tutorial, just sign up for the tutorial newsletter on the right side!

Zurück zur Tutorial Übersicht Back to Tutorial Overview

Today we show you how to install the Ghost Blogging platform on Ubuntu 16.04 The professional publishing platform Ghost is in many ways a special blogging tool. Ghost is based on Node.js and was written entirely in JavaScript. In addition, Ghost is open-source software and acts as a non-profit organization. Especially developers get their money’s […]

Schade, dass dir der Artikel nicht gefallen hat.
Was sollten wir deiner Meinung nach besser machen?

Thank you for your feedback!
We will get back to you as soon as the article is finished.

Übrigens: kennst du schon unser Tutorial zum Thema Set up Apache vHost on Ubuntu?