Set up a blog with Ghost

Curious software engineer
Search for a command to run...

Curious software engineer
No comments yet. Be the first to comment.
In this series, I will treat subjects related to software development, software engineering, and related career.
I wanted to share my point of view on the question based on my personal experience. But better be clear straight away, it will take time! Prerequisites: A computer Perseverance A lot of time Here are the steps I went through and that you should ...
It’s the summer holidays, after all. So I wanted to spent some time with my 7 years old daughter to teach her programming. ⌨️ I spent some time before discussing with her some of the basics concept verbally: the different parts of a computer, and bas...

This article is a follow up on my previous one introducing the concept of SE Spectrum: https://sonny.alvesdi.as/a-better-way-to-discuss Existing solutions For long, the easiest way to run a spectrum was to use visual drawing or diagram tools like ...

Introduction to SE Spectrum

One of the greatest tool available on GitHub is Dependabot. For those not familiar with it, in short it's a bot reviewing your list of dependencies and proposing PRs to update them. https://docs.github.com/en/code-security/getting-started/dependabot-...

Photo by Harli Marten on Unsplash As long as I remember I have always been interested by skepticism. And I think one element that really resonated with me has been that conference talk by Phil Plait: https://www.youtube.com/watch?v=FrFRbGjUtJk 15 ...

Let's say you are doing freelance work for a client who wants to launch a blog. While Hashnode is great, it's probably not adapted in every case. Especially for non-developers and if you need high customization also.
Here I propose to deploy a blog using Ghost.
Prerequisites:
A server with yourdomain.com already pointing at it
5-10 minutes
Ghost is running on Node.js, it is a modern and very straightforward solution to anyone willing to start a blog. The Ghost developers also offer hosting on their website, if you want more info: https://ghost.org/
Now here is the process. First, we create a folder blog and a script start.sh. Then we run the script.
mkdir /blog && cd /blog
echo docker run -d --name ghost -p 2368:2368 -e url=http://yourdomain.com -v /blog/content:/var/lib/ghost/content --restart=always ghost:alpine > start.sh
chmod +x start.sh
./start.sh
Finally, have a server in Nginx in front of it:
server {
server_name my.blog.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my.blog.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my.blog.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = my.blog.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
server_name my.blog.com;
listen 80;
return 404; # managed by Certbot
}
You can notice I use Certbot, if you don't know about Certbot, check my article:
Now you can visit yourdomain.com and see your blog in action.
Photo by Tandem X Visuals on Unsplash