Let us say you just started and you just hosted your first ghost server. You used a temporary domain name just to test it out. Now you figured everything out and you want to change the domain name.
1. Changing the domain name
I will start from the beginning.
- Connect to your server
- Navigate to your ghost folder
Tip: When navigating through the folders and files type one letter or multiple and hit
tabthe terminal will paste the first folder or file that starts with the letter combination.
In case you followed the ghost guide, you probably created a new user, so your access will be denied.
sudo su -- <youruser> and repeat the beginning of step 2.
Check for the config.production.json
lsIt will show you all the folders and files. If you see the config.production.json, then
Edit the config.production.json
At the top of the config, you will see the following:
Navigate with your arrow keys to the URL and replace it with the new URL.
ctrl + Sto save
ctrl + Xto close
- Now we need to integrate the new URL
ghost setup nginx
ghost setup ssl"Only if you want an SSL certificate"
Changing the domain name in Ghost is a simple process. Access the
config.production.json file, replace the old URL with the new one, and integrate the changes by configuring NGINX, setting up SSL (optional), and restarting Ghost. With the domain name updated, your website will be ready to go under the new URL.