Get access to a growing collection of Premium Ghost Themes with the Yearly Subscription 🔥33% Off

How to update your Ghost site URL when self-hosting

A step by step guide to changing the URL of your Ghost CMS site when self-hosting. From setting up your domain DNS and Ghost config, to creating the SSL certificate

Norbert
Norbert3 min read

Transitioning to a new domain name is an important step in rebranding your online presence or aligning your website with a new brand identity. If you are self-hosting your Ghost CMS, changing your domain requires some technical know-how.

That's what we had to do a couple of weeks ago. In this comprehensive guide, we will walk you through the process of changing your Ghost CMS domain seamlessly and efficiently. From updating the configuration file to modifying DNS settings, we will cover everything you need to ensure a smooth transition.

Let's get started!

Update the DNS configuration

The first step in this process is making sure that the new domain directs visitors to your Ghost CMS installation.

Log in to your domain registrar's website and navigate to the DNS settings for your domain. Modify or create the "A" record to point to the IP address of your server.

Change the Ghost CMS config file

The next step is updating the domain in the Ghost config file. For this you need to connect to your server via SSH using your preferred terminal. Navigate to the directory where your Ghost CMS installation is located, for example:

cd /var/www/ghost

When you are in the correct directory, run the following command using Ghost-CLI:

ghost config url https://yourdomain.com

You can always run ghost --help or ghost [command] --help to get more detail, or inline help for available options.

For more info, visit the config guide.

Set up Nginx

The next step is creating the nginx config file for the new domain, for this run:

ghost setup nginx

This command will create an nginx config file in ./system/files/ and adds a symlink to /etc/nginx/sites-enabled/, required for serving your Ghost installation on the new domain.

Generate the SSL certificate

Next, you need to install a new certificate for the new domain, for this run:

ghost setup ssl

Let's Encrypt provides SSL certificates and Ghost uses acme.sh for provisioning and renewing SSL certificates. During the SSL setup, you'll need to provide an email address.

Restart Ghost

The last step is restarting your Ghost CMS installation.

ghost restart

Running this command will stop and then start your site using the configured process manager. The default process manager is systemd, or local for local installs.


That's it, by following the above steps you've successfully transitioned to your new domain.

More in Guides & Tutorials

All guides
Ghost Pro Hosting

Get the best managed Ghost CMS hosting and focus on bringing value to your audience.