Ghost was unable to start on fresh installation (unit service not found)

Hi, I am installing Ghost on Ubuntu v22.04.1 LTS but Ghost can not start.
Here is the output of ghost install:

...
✔ Configuring Ghost
✔ Setting up instance
+ sudo chown -R ghost:ghost /usr/share/nginx/html/blog/content
✔ Setting up "ghost" system user
ℹ Setting up "ghost" mysql user [skipped]
? Do you wish to set up Nginx? Yes
+ sudo mv /tmp/blog/blog.conf /etc/nginx/sites-available/blog..conf
+ sudo ln -sf /etc/nginx/sites-available/blog.conf /etc/nginx/sites-enabled/blog.conf
+ sudo nginx -s reload
✔ Setting up Nginx
? Do you wish to set up SSL? No
ℹ Setting up SSL [skipped]
? Do you wish to set up Systemd? Yes
+ sudo mv /tmp/blog/ghost_blog.service /lib/systemd/system/ghost_blog.service
+ sudo systemctl daemon-reload
✔ Setting up Systemd
+ sudo systemctl is-active ghost_blog
? Do you want to start Ghost? Yes
+ sudo systemctl start ghost_blog
✖ Starting Ghost
One or more errors occurred.

1) ProcessError

Message: Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#'  systemctl start ghost_blog
Failed to start ghost_blog.service: Unit ghost_blog.service not found.


Exit code: 5


Debug Information:
    OS: Ubuntu, v22.04.1 LTS
    Node Version: v14.20.0
    Ghost Version: 5.13.0
    Ghost-CLI Version: 1.23.0
    Environment: production
    Command: 'ghost install'

Here is the output of ghost doctor:

✔ Checking system Node.js version - found v14.20.0
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_blog-quangnv-com
✔ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v14.20.0

Please help, thanks in advanced.

What can you see with…

sudo journalctl -u ghost_blog

@mjw thank you.
It said that

systemd[1]: ghost_blog.service: Failed to open /etc/systemd/system/ghost_blog.service: No such file or directory

The file do exist but it links to an old version of ghost that I have uninstalled.
I just delete that link, reinstall ghost and it works.

2 Likes