✖ Setting up "ghost" mysql user fails + droplet

Ghost installation fails the mysql setup

i tried 5+ times, always same.

any idea? thank you!

✖ Setting up “ghost” mysql user

✔ Checking system Node.js version - found v18.17.1

✔ Checking current folder permissions

✔ Checking memory availability

✔ Checking free space

✔ Checking for latest Ghost version

✔ Setting up install directory

✔ Downloading and installing Ghost v5.85.1

✔ Finishing install process

? **Enter your blog URL:**

✔ Configuring Ghost

✔ Setting up instance

+ sudo useradd --system --user-group ghost

+ sudo chown -R ghost:ghost /var/www/ghost/content

✔ Setting up "ghost" system user

**✖ Setting up "ghost" mysql user**

+ sudo mv /tmp/mydomain-com/ /etc/nginx/sites-available/

+ sudo ln -sf /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

+ sudo nginx -s reload

✔ Setting up Nginx

? **Enter your email (For SSL Certificate)**

+ sudo mkdir -p /etc/letsencrypt

+ sudo ./ --install --home /etc/letsencrypt

+ sudo /etc/letsencrypt/ --issue --home /etc/letsencrypt --server letsencrypt --domain --webroot /var/www/ghost/system/nginx-root --reloadcmd "nginx -s reload" --accountemail --keylength 2048

+ sudo openssl dhparam -dsaparam -out /etc/nginx/snippets/dhparam.pem 2048

+ sudo mv /tmp/ssl-params.conf /etc/nginx/snippets/ssl-params.conf

+ sudo mv /tmp/mydomain-com/ /etc/nginx/sites-available/

+ sudo ln -sf /etc/nginx/sites-available/ /etc/nginx/sites-enabled/

+ sudo nginx -s reload

✔ Setting up SSL

+ sudo mv /tmp/mydomain-com/ghost_mydomain-com.service /lib/systemd/system/ghost_mydomain-com.service

+ sudo systemctl daemon-reload

✔ Setting up Systemd

+ sudo systemctl is-active ghost_mydomain-com

+ sudo systemctl start ghost_mydomain-com

+ sudo systemctl stop ghost_mydomain-com

✖ Starting Ghost

One or more errors occurred.

1) ConfigError

Error detected in the production configuration.

Message: connect ECONNREFUSED

Configuration Key(s): / database.connection.port

Current Value(s): / 3306

Help: Ensure that MySQL is installed and reachable. You can always re-run `ghost setup` to try again.

2) GhostError

Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED

Help: Unknown database error

Suggestion: journalctl -u ghost_mydomain-com -n 50

Debug Information:

    OS: Ubuntu, v22.04.3 LTS

    Node Version: v18.17.1

    Ghost Version: 5.85.1

    Ghost-CLI Version: 1.26.0

    Environment: production

    Command: 'ghost install --auto --db=mysql --dbhost= --dbport=3306 --dbname=ghost_production --dbuser=root --dbpass=888b26c6f701b879877afbe3c89d31b9cc06ac90ff58f346 --dir=/var/www/ghost --start'

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
June 17, 2024


I’ve just tested the same image with the lowest Droplet and I was able to reproduce the issue. I believe the smallest Droplet is not a good fit for that and would recommend you to try with a larger one.

Bobby Iliev
Site Moderator
Site Moderator badge
June 16, 2024


This is indeed quite strange, it sounds like MySQL is failing to start, this could be due to the server resources.

What is the size of the Droplet that you are using to deploy this? Also what type of CPU are you using?

I’ve tested this just now with a 1GB RAM Droplet and it failed with:

✖ Checking memory availability
One or more errors occurred.

1) SystemError

So this could explain why your MySQL instance was failing as it would not have enough memory to run properly.

But the I also tested this with 2GB RAM Droplet seems to have worked as expected. Can you give this a try with a larger Droplet?

If you still get that error, can you share the output of the journalctl -u ghost_mydomain-com -n 50 command?

- Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel