> ## Content Index
> Fetch the complete content index at: https://blog.jsinh.in/llms.txt
> Use this file to discover other available public pages before exploring further.

# Installing Ghost on Ubuntu, Nignx and MySQL - Part 1
- URL: https://blog.jsinh.in/installing-ghost-on-ubuntu-nignx-and-mysql-part-1/
- Published: 2014-05-10T22:59:00.000Z
- Updated: 2026-07-07T15:13:26.000Z
- Author: Jsinh
- Tags: #Import 2026-10-04 19:16

I am using [DigitalOcean](https://www.digitalocean.com/?refcode=8a6cc3b858ed&ref=blog.jsinh.in) for hosting my Ghost blog. Any instance of hosting in DigitalOcean environment are called Droplets (wonder why?).

Mostly setting up a Ghost blog in DigitalOcean environment is pretty much easy. But after few days I realized that the setup is good enough for 'getting up and running' and I had to fiddle and fix many thing to reach my satisfactory goals. Offcourse I give full credits to all articles and knowledge-base provied by DigitalOcean team.

Things that makes me write up this lengthy post:

- Ghost ready droplet gives only basic setup of Ghost.
- Had to add more steps to secure my droplet to some extent.
- Wanted to host Ghost with MySQL instead of Sqlite3.
- Setup Ghost instance in a way so that I can add more Ghost instances or other websites in same droplet.

I have divided this process into three part (this is **Part 1 of 3**)

Let's begin:

First we will create a droplet in DigitalOcean account.

**Step:** Sign-up or Log-in into your DigitalOcean account

**Step:** Click on Create Droplet

![DigitalOcean - Create Droplet](https://blob.jsinh.in/media/2014/05/11/DigitalOcean-Create-Droplet.png)

**Step:** Select a host name for your droplet

![DigitalOcean - Select Hostname, Size and region](https://blob.jsinh.in/media/2014/05/11/DigitalOcean-CreateDroplet-Step01.png)

You can choose this as per your needs.

**Step:** Select image, make sure you select Linux Distribution > Ubuntu 12.xx image and not Application > Ghost on Ubuntu 12.xx. But off-course if you wish to use Ubuntu 13.xx or Ubuntu 14.xx its fine.

**Update 8th Sept, 2016:** This works fine now with Ubuntu 16.04.1 x64 and Ghost 0.10.1 - tested it myself.

![DigitalOcean - Select Image](https://blob.jsinh.in/media/2014/05/11/DigitalOcean-CreateDroplet-Step02.png)

In few moments your will have your droplet ready. DigitalOcean will send you the `root` user login credentials in registered mail address. If not received Droplet > Access > Reset Root Password to reset it again.

**Step:** Click on the newly created droplet > Access Tab > Console Access.

![DigitalOcean - Console Access](https://blob.jsinh.in/media/2014/05/11/DigitalOcean-CreateDroplet-Step03.png)

This will take you to the main console (tty1) of your droplet. On login prompt enter your credentials (received in mail).

Now first thing first, we will secure access to this droplet to specific user only via specific non-default port.

**Step:** Change password of root user (keep in mind: make sure this password is complex enough and not shared with anyone)

If you are not logged in as root type:

```
sudo -i

```

Now change password of root:

```
passwd

```

Enter your new password two times.

**Step:** Add new user which you can use to SSH into this droplet (eg: demoghost):

```
adduser demoghost

```

**Step:** Add this user to SUDO group:

```
sudo usermod -aG sudo demoghost

```

Step: Add newly created user to sudoer

```
sudo visudo

```

Step: Find the following line : `root ALL=(ALL:ALL) ALL` and add a new line after it:

```
demoghost	ALL=(ALL:ALL)	ALL

```

Save this changes (Ctrl + x > Yes > Enter).

**Step:** Edit SSH configuration

Open SSH config in NANO editor (your can use your choice of editor)

```
sudo nano /etc/ssh/sshd_config

```

Find following line:  
`Port 22` and replace default port number 22 to port number of your choice.

Next find following line:  
`PermitRootLogin yes` and change it to `PermitRootLogin no`

Next go to end of the file and add following line:  
`AllowUsers demoghost`

This line will only allow listed users to login via SSH (demoghost in my case).

Next find following line:  
`LoginGraceTime 120`

change the value **120** to **20**.

Save the configuration changes (Ctrl + x > Yes > Enter).

Restart SSH server:

```
sudo service ssh stop
sudo service ssh start

```

Now you can close your console access and login (using new user - demoghost) to your droplet via SSH using [cmder](http://cmder.net/?ref=blog.jsinh.in) or [putty](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html?ref=blog.jsinh.in) or [tera-term](https://ttssh2.osdn.jp/index.html.en?ref=blog.jsinh.in) (on Windows) or Terminal (on Linux).

Proceed to [Part 2 of Installing Ghost on Ubuntu, Nignx and MySQL](https://blog.jsinh.in/installing-ghost-on-ubuntu-nignx-and-mysql-part-2)