How to update the URL of your self-hosted Ghost site
If you want to change the URL of your self-hosted Ghost site, there are a few steps to make, but luckily they are very straight-forward.
Step 1: Update your domain's DNS
You will first need to point your new domain to your server. This is done by creating an A record in your domain provider pointing to your server's IP address.
Step 2: Edit your site's config file
The next step is to log on to your server and edit your Ghost site's URL.
cd
into the correct folder where Ghost is located (on Digital Ocean, it will be in /var/www/ghost
) and run
ghost config url https://yournewdomain.com
Make sure to add the protocol (https
in this example).
Step 3: Set up Nginx
Now run ghost setup nginx
. This will set up some server-level files for serving your Ghost site for the domain.
Step 4: Create an SSL certificate
Run ghost setup ssl
. This will go through the Let's Encrypt process for creating a fresh (free) SSL certificate. You will need to input an email address during the installation.
Step 5: Restart Ghost
Run ghost restart
to reload the Ghost software (this refreshes all the links across your site).
And you're done!