Ghost博客搭建教程(Ubuntu 20.04),,1. 安装Node.js和npm,“
bash,sudo apt update,sudo apt install nodejs npm,
`,,2. 创建Ghost博客文件夹,
`bash,mkdir ~/ghostblog,cd ~/ghostblog,
`,,3. 下载并安装Ghost,
`bash,wget https://ghost.org/zip/ghostlatest.zip,unzip ghostlatest.zip,
`,,4. 配置Ghost,
`bash,cd content/config.development.json,nano config.development.json,
`,在文件中添加以下内容:,
`json,{, "url": "http://yourdomain.com",, "server": {, "port": 2368,, "host": "127.0.0.1", },, "database": {, "client": "sqlite3",, "connection": {, "filename": "ghostdev.db", },, "debug": false,, "migrations_directory": "migrations", },, "mail": {, "transport": "Direct", },, "logging": {, "transports": [, "file",, "stream", ], },, "process": "local",},
`,保存并退出。,,5. 启动Ghost,
`bash,cd ../core,npm start development,
“,访问 http://localhost:2368 ,您将看到Ghost的欢迎页面。您可以按照提示设置您的博客。搭建个人博客_手工搭建Ghost博客(Ubuntu 20.04)

(图片来源网络,侵删)
1、安装Node.js和npm
我们需要在Ubuntu 20.04上安装Node.js和npm,打开终端并运行以下命令:
sudo apt update sudo apt install nodejs npm
2、安装Ghost CLI
我们需要安装Ghost的命令行工具(CLI),运行以下命令来全局安装Ghost CLI:
sudo npm install g ghostcli@latest
3、创建一个新的Ghost项目
现在我们可以创建一个新的Ghost项目,运行以下命令并按照提示操作:
ghost install
这将引导你完成以下步骤:
选择你的博客平台(本地、Heroku、DigitalOcean等)

(图片来源网络,侵删)
输入你的博客URL
设置数据库配置(如果你选择了本地平台,可以跳过此步骤)
设置邮件配置(如果你不需要发送邮件通知,可以跳过此步骤)
设置管理员账户信息
4、启动Ghost博客
安装完成后,你可以使用以下命令启动Ghost博客:
ghost start
这将启动一个开发服务器,你可以在浏览器中访问http://localhost:2368
来查看你的博客。
5、部署到生产环境

(图片来源网络,侵删)
如果你想将你的博客部署到生产环境,你需要先停止开发服务器,然后使用以下命令构建静态文件:
ghost build
这将生成一个名为built
的文件夹,其中包含你的博客的所有静态文件,你可以将这些文件部署到你的服务器上。
注意:部署到生产环境时,请确保你已经正确配置了数据库和邮件服务,具体配置方法可以参考Ghost官方文档。
【版权声明】:本站所有内容均来自网络,若无意侵犯到您的权利,请及时与我们联系将尽快删除相关内容!
发表回复