# Set up multiple Ghost blogs for $5 a month – Part 2

> Second part of my tutorial on creating multiple ghost blogs on a single digital ocean droplet for only $5 per month.

Published: 2019-12-02 · Updated: 2020-11-06 · Author: John Slater · Canonical: https://www.slaterjohn.com/set-up-multiple-ghost-blogs-for-5-a-month-part-2

---

![Title card reading Hosting Multiple Ghost Blogs Part 2, with the Ghost logo on a cream background](https://www.slaterjohn.com/images/2020/11/Part-2-1.png)

> **This guide is out of date:** I wrote this for Ghost version 3 back in 2019. Newer versions of Ghost handle multiple installs much better on their own, so these steps no longer apply – please don’t follow them on a current version. I’m keeping the article up for reference only.

So in Part 1 we covered setting up your brand spanking new [Digital Ocean](https://m.do.co/c/90b41bc07d4a) droplet and first Ghost blog.

In this part we will discuss adding more than one blog to the same server. Let’s jump in.

## SSH

_[If you’re following on from Part 1 you can ignore this step.](/set-up-multiple-ghost-blogs-for-5-a-month-part-1)_

Connect to your DO droplet using the console (Digital Ocean dashboard) and login using your new password.

## New linux user

Ghost will not install if you are the root user, and for good reason too. So before we can create our next blog we need to create our very own user, with super user privileges, to do all the install stuff.

To create a new user type the following command into the droplet console

```bash
adduser mrghost
```

Creates a new user called mrghost

The first thing you’ll be asked for is a password for the user. Make this a secure password and store it somewhere safe, like 1Password.

You’ll then be asked to fill out some details, like name, but you can hit enter on these steps as they are not required.

## User permissions

In order for that user to be able to install Ghost it will need super user permissions.

```bash
usermod -aG sudo mrghost
```

Sets the user mrghost as a super user

You can test whether the user has super user permissions by running a command.

```bash
su - mrghost
```

Login as mrghost

```bash
sudo ls -la /root
```

Outputs the permissions of the root folder, which only a super user can do

You’ll need to enter the password for mrghost. Once you’ve done that you will see all the files and folders in the root folder output along with their permissions.

The new user is setup and ready for use. Now let’s go back to the root user by logging out of mrghost.

```bash
logout
```

Logs out the current user.

## Create new blog directory

We need to create a new directory in the `www` to house your new blog.

```bash
cd /var/www
```

Change directory to /var/www

You’re now in the directory for `www`. If you run the command `ls` – which lists the content of the current directory – you’ll see a folder called `ghost`. This is the folder for the first blog you created.

So let’s create a new one. The naming convention we will use is your domain name.

Important: Make sure the domain name for the second blog is pointing to your server.

```bash
sudo mkdir portfolio.example.com
```

Create new directory called portfolio.example.com

Now give mrghost permission.

```bash
sudo chown mrghost:mrghost ./portfolio.example.com
```

And lastly change to the new directory so we can start running commands from there…

```bash
cd portfolio.example.com
```

## Default MySQL passwords

Before we continue you will need your default MySQL password from the server. When setting up your droplet Digital Ocean stores this password in a file so you can save it later.

```bash
sudo cat /root/.digitalocean_password
```

This will spit out a password for `root` and a password for the `ghost` MySQL user. Save these to a password manager for later.

## Create new MySQL user for future installs

For this new blog and all future blogs we will need a user we can use without worrying about messing up the user ghost created. This new user will be called `casper`.

```bash
sudo mysql
```

Enter MySQL

```sql
CREATE USER 'casper'@localhost IDENTIFIED WITH mysql_native_password BY 'YOUR_PASSWORD';
```

Create the new casper user.

Make sure the password you use is secure. And don’t forget it.

You can make sure it was added with the following command…

```sql
SELECT User FROM mysql.user;
```

Output all MySQL users

… and we’re done.

```sql
exit;
```

Exit MySQL

Now we have a new user setup for MySQL and we can start installing Ghost.

## Installing Ghost

We’re going to start installing Ghost in that new folder you created earlier.

Because Ghost cannot be run as the `root` user we need to login as `mrghost` to install it.

```bash
su - mrghost
```

Login as mrghost

Make sure you’re in your new blog directory.

```bash
cd /var/www/portfolio.example.com
```

And then run the installer…

```bash
ghost install
```

During the install process ghost will ask you a bunch of questions that are almost the same as the first blog you created. Just select the defaults for almost everything.

Make sure during installation that you use the new `casper` MySQL credentials for MySQL steps.

You may be asked for the password for `mrghost` during setup.

After you’ve finished the setup ghost will ask to start and when you select yes. It will fail!

## Ghost failed to start

Ghost won’t be able to start because the `casper` user doesn’t have permission to edit the database ghost just created. Here’s how we fix that.

```bash
sudo mysql
```

Then…

```sql
GRANT ALL PRIVILEGES ON portfolio_example_com_prod.* TO 'casper'@'localhost';
```

Then…

```sql
exit;
```

And we can try to run Ghost again.

```bash
ghost run
```

You’ll see the command line spit out some logs showing that it’s creating new tables in the database. That means it’s working. Once it’s settled you’ll be able to access your website by the domain name.

You’re all set. Now you can stop ghost from running and start it properly.

Press Control+C and type the following command…

```bash
ghost start
```

## New blog complete

You’re all set and your new blog is online.

You can repeat this step to create as many blogs as you need. If you find them not performing as well as they could you should think about scaling your Digital Ocean droplet up.

## Other articles and links

I figured out how to do this using a bunch of different sources and articles on setting up Ghost blogs.

- [How to Grant All Privileges on a Database in MySQL](https://chartio.com/resources/tutorials/how-to-grant-all-privileges-on-a-database-in-mysql/)
- [How To Create a Sudo User on Ubuntu](https://www.digitalocean.com/community/tutorials/how-to-create-a-new-sudo-enabled-user-on-ubuntu)
- [How to install Ghost on Ubuntu](https://ghost.org/docs/install/ubuntu/#overview)
- [How to resolve errors when running ghost start](https://ghost.org/faq/errors-running-ghost-start/)
