How to Install, Setup, and Use Ghost on Ubuntu (Ultimate Guide)

Ghost is a popular open-source headless content management system (CMS) that is designed for creating and managing professional blogs and websites. In this ultimate guide, we will walk you through the step-by-step process of installing, setting up, and using Ghost on Ubuntu.

Step 1: Install Node.js

The first step to setting up Ghost on Ubuntu is to install Node.js. Node.js is a runtime environment that allows you to run JavaScript code outside of a web browser. To install Node.js, open the terminal on your Ubuntu system and run the following commands:

sudo apt update
sudo apt install nodejs
sudo apt install npm

Step 2: Install Ghost-CLI

Next, you will need to install Ghost-CLI, which is a command line tool for managing Ghost installations. To install Ghost-CLI, run the following command in the terminal:

sudo npm install -g ghost-cli

Step 3: Install MySQL

Ghost requires a database to store content and settings. We will use MySQL as the database for this guide. To install MySQL, run the following command in the terminal:

sudo apt install mysql-server

During the installation process, you will be prompted to set a password for the MySQL root user. Make sure to remember this password, as you will need it later.

Step 4: Create a MySQL Database and User

Once MySQL is installed, you will need to create a new database and user for Ghost. To do this, log into the MySQL server with the following command:

sudo mysql -u root -p

Enter the MySQL root password when prompted. Then, run the following commands to create a new database and user for Ghost:

CREATE DATABASE ghost;
CREATE USER ‘ghostuser’@’localhost’ IDENTIFIED BY ‘password’;
GRANT ALL PRIVILEGES ON ghost.* TO ‘ghostuser’@’localhost’;
FLUSH PRIVILEGES;
EXIT;

Step 5: Install Ghost

Now that Node.js, Ghost-CLI, and MySQL are all set up, you can install Ghost on your Ubuntu system. Navigate to the directory where you want to install Ghost and run the following command:

ghost install

Follow the on-screen prompts to set up your Ghost installation. When prompted for the database connection, enter the following details:

MySQL Host: localhost
MySQL User: ghostuser
MySQL Password: password
MySQL Database: ghost

Once the installation is complete, you can access your Ghost site by visiting http://localhost:2368 in your web browser.

Step 6: Customize Your Ghost Site

Now that Ghost is installed and running on your Ubuntu system, you can customize your site by logging into the Ghost admin panel. To access the admin panel, visit http://localhost:2368/ghost and enter the username and password you set during the installation process.

From the admin panel, you can create new posts, manage settings, and customize the look and feel of your Ghost site.

In conclusion, setting up and using Ghost on Ubuntu is a straightforward process that can be completed in just a few steps. By following this ultimate guide, you can create a professional blog or website using Ghost on your Ubuntu system.