Install Ghost Manually on a subdomain.

January 6, 2015 1.8k views

I'm having a hard time installing ghost on my droplet. The guides I found online seems to be missing something.

My droplet run ubuntu 14.04 LTS. I want to run ghost on a subdomain ( . I used the guide to here to add subdomains on nginx and got it working. I followed this guide until the part "configure ghost" . I changed the config.example.js file adding on the url "" but I left the host untouched.

Can anyone find me a guide that helps me install ghost on a subdomain using nginx that guide us through the whole process until it is working on port 80?

1 Answer

Setting up Ghost to run on a subdomain behind an Nginx reverse proxy shouldn't be much different than setting it up normally. The key is to set the server_name directive in your Nginx configuration file.

server {
    listen 80 default_server;
    listen [::]:80 default_server ipv6only=on;


    root /usr/share/nginx/html;
    index index.html index.htm;

    client_max_body_size 10G;

    location / {
        proxy_pass http://localhost:2368;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_buffering off;

You'll also need to setup a DNS record pointing the subdomain to the server.

For all the details on setting Ghost up with Nginx, check out this tutorial:

by Alex LaFroscia
This is our tutorial on hosting Ghost with Nginx on DigitalOcean.
Have another answer? Share your knowledge.