Always make sure to backup your droplet before doing any server work.
If you already installed Ghost on DigitalOcean using the Ghost 1-Click App and want to install an additional Ghost instance on the same droplet.
- You are logged in to your droplet using SSH from the command line
- Your domain name is ready and connected to the droplet IP
- You know what you are doing :)
➊ You need the current MySQL host, username, and password.
cd /var/www/ghost/ cat config.production.json
Take notes of them. You will use them later in steps 3 and 5.
➋ Create a website directory, for example,
cd /var/www/ sudo mkdir ubud sudo chown ghost-mgr:ghost-mgr ubud/
➌ Login to MySQL and create a new database
sudo mysql -u root -p CREATE DATABASE ubud; GRANT ALL PRIVILEGES ON ubud.* to 'ghost'@'localhost' IDENTIFIED BY '7d150600c49e7c5860be7ce03d4f8df67259176738d926ec'; FLUSH PRIVILEGES; exit
ghost→ database user
localhost→ database host
7d150600c49e7c5860be7ce03d4f8df67259176738d926ec→ database password
➍ Switch to the
sudo -i -u ghost-mgr
➎ Install Ghost and follow the installation steps
cd /var/www/ubud/ ghost install
That’s all that I wanted to share today, and I hope you find this post helpful.