How to Set Up Ghost on Ubuntu server
Hey there! So, I recently dove into setting up Ghost, the awesome blogging platform, on my Ubuntu virtual server. Let me tell you, it was a bit of a ride—fun, but not without its quirks! If you’re thinking about giving Ghost a spin, stick with me. I’ll walk you through my first hands-on experience, share some tips, and hopefully save you a few headaches. Ready? Let’s do this!
First off, I’m running an Ubuntu Server on a Parallels virtual machine on my Mac. It’s my little sandbox for messing around before I commit to a real Virtual Dedicated Server (VDS). On my macOS, I just use the default Terminal app—nothing fancy. If you’re wondering about my setup, it’s pretty bare-bones: a clean Ubuntu Server, an FTP server, and Node.js. No Apache, no Nginx, just the essentials.
Note: This guide assumes you’ve got a similar minimal setup. If you’re running a full web server stack already, some steps might differ, but the core process should still apply!
Step 1: Getting Ghost Onto Your Server
The first thing you need to do is get the Ghost files onto your server. I’m a fan of GUI tools, so I used my go-to FTP client, Transmit, to upload the Ghost files. It’s super intuitive—just drag and drop. But if you’re a terminal enthusiast (no judgment!), you can clone the Ghost repo directly from GitHub. Here’s the command:
git clone https://github.com/TryGhost/Ghost.git
This pulls the latest Ghost source code into a folder named Ghost
on your server. Easy peasy, right?
Step 2: Installing Ghost
Now that Ghost is on your server, it’s time to install it. Navigate to the Ghost folder using the terminal:
cd Ghost
Once you’re in the folder, run the following command to install all the necessary dependencies:
npm install --production
The --production
flag tells npm to skip dev dependencies, keeping things lean for your server. This step might take a minute, depending on your server’s speed and internet connection. Grab a coffee, maybe pet a dog—whatever vibes with you.
Step 3: Firing Up Ghost
Alright, moment of truth! To start Ghost, run this command in the same folder:
npm start --production
If all goes well, Ghost will start running on your server, typically at http://localhost:2368
. You’ll see some output in the terminal confirming it’s up and running. At this point, you might be thinking, “Wow, that was easy!” But hold up—there’s a catch!
Surprise! Networking Gotchas
Here’s where things got spicy for me. I tried accessing Ghost from my host machine (my Mac, outside the virtual server), and… nothing. Zilch. Ghost was running, but it wasn’t accessible on my local network. Turns out, Ghost binds to 127.0.0.1
(localhost) by default, which means it’s only available on the server itself—not from other devices on your network.
To fix this, you need to tell Ghost to listen on your server’s external IP address. First, find your server’s IP address by running this command in your Ubuntu terminal:
ifconfig
Look for the network interface (usually something like eth0
or ens33
) and note the inet
address (e.g., 192.168.1.100
). That’s your server’s local network IP.
Next, open Ghost’s configuration file, config.production.json
, located in the Ghost folder. You can use a text editor like nano
:
nano config.production.json
Find the server
section, which probably looks something like this:
"server": { "host": "127.0.0.1", "port": 2368 }
Change "host": "127.0.0.1"
to your server’s external IP, like so:
"server": { "host": "192.168.1.100", "port": 2368 }
Save the file (in nano
, press Ctrl+O
, then Enter
, and Ctrl+X
to exit). Restart Ghost with:
npm start --production
Now, from your host machine, you should be able to access Ghost by navigating to http://192.168.1.100:2368
in your browser. Boom—there’s your Ghost blog!
Wrapping Up
Setting up Ghost on a bare-bones Ubuntu server was a bit of an adventure, but totally worth it. Once you get past the networking hiccup, it’s smooth sailing. You’ll have a sleek, modern blogging platform ready to go. From here, you can start tweaking themes, adding content, or even setting up a reverse proxy if you want to get fancy.
If you hit any snags, double-check your IP settings and make sure your virtual machine’s network is set to bridged mode (not NAT) in Parallels. That was another “aha!” moment for me. Got questions or run into issues? Drop a comment or hit up the Ghost community—they’re super helpful.