惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
J
Java Code Geeks
博客园 - 聂微东
量子位
C
Check Point Blog
T
The Blog of Author Tim Ferriss
T
Tailwind CSS Blog
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
B
Blog
罗磊的独立博客
腾讯CDC
GbyAI
GbyAI
博客园 - 【当耐特】
A
About on SuperTechFans
M
MIT News - Artificial intelligence
U
Unit 42
D
Docker
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Y
Y Combinator Blog
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队

Example blog

Ghost routing explained with routes.yaml examples — routes, collections & taxonomies Ghost redirects explained with practical redirects.yaml examples How to Serve JSON or XML Data in Ghost How to Change Your Default Post Template in Ghost Ghost Custom Theme Settings How to add Google Fonts to Ghost Themes How to Configure Ghost with Mailgun Ghost Theme Structure & Organization How to Make Custom Templates in Ghost Themes How to Install Ghost CMS via Ghost-CLI How to Add Syntax Highlighting to Ghost The best Ghost CMS hosting platforms Ghost 6.0 — Social Web and Native Ghost Analytics Ghost CMS Social web beta, email 2FA and more author social links How to keep custom design settings when updating your Ghost theme How to use the public preview card in Ghost How to add members-specific sections in Ghost How to customize the default content CTA in Ghost How to build a custom homepage in Ghost An overview of Ghost editor cards and and how they work Ghost CMS News: One-time payments & collecting sales tax How to customize the private site access template in Ghost How to add custom fonts in Ghost themes Ghost CMS News: Additional payment methods & internal linking How to use Code Injection in Ghost How to set meta data of your custom routes & collections in Ghost Ghost CMS News: TK reminders, ActivityPub and improvements How to format dates and use the date helper in Ghost Ghost CMS internationalization, custom fonts & spam protection Understanding and optimizing post and page settings in Ghost CMS
How to update your Ghost site URL when self-hosting
Bright Themes · 2023-09-05 · via Example blog

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

Note

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.