How to set up Ghost one-click app for Ubuntu 16.04

Introduction

Ghost is a lightweight open source blogging platform. It is fully customizable and has many themes available.

Using Tencent Cloud's one-click Ghost application, you can pre-install Tencent [CVM] (https://cloud.tencent.com/product/cvm?from=10680) with Ghost. There are some command lines to complete the installation, and then you can use a simple and powerful secure blog tool that allows you to manage your daily writing through its web interface. If you only want to set up from a web browser, you may prefer to start with an account with Ghost hosting.

prerequisites

To follow all the steps in this tutorial, you need:

When you set the domain name on Tencent Cloud, you can start.

Step 1-Create Ghost Tencent CVM

Start with the creation of Ghost Tencent CVM. In the "Choose Image" section, click the "Click" Application tab and select the Ghost image on **16.04.

Next, choose the size, region and any other settings (such as private network, IPv6 support or backup). If you want, you can add any SSH keys and customize the hostname for CVM. When ready, click "Create Tencent CVM" to start the server.

After creating the CVM, please visit http://your_server_ip in the web browser. You will see a placeholder page that says Please log in to your Tencent CVM via SSH to configure Ghost installation.

This security measure is in place to protect the initial configuration of Ghost, and anyone who visits the site can create administrative users.

Step 2-Set up domain name

Once you know the IP address of your Ghost Tencent CVM, you need to add an A name record for your blog. To do this, please use the "Network" link in the main navigation to find the domain name you want to use from the "Domains" list. You will reach the A name record creation page.

We plan to host our new blog at https://blog.digitalocean.love, we will enter blog as our hostname. The domain name will be attached automatically. Then we will select our new Ghost Tencent CVM from the list in the Will Direct To list. Finally, we will keep the default value of TTL (seconds) and click Create Record:

Now that we have established a connection between our domain name and Tencent CVM, we are ready to continue.

Step 3-Use SSH to log in to Tencent CVM

After creating Tencent CVM, you can connect to CVM as root via SSH to access it. This will enable Ghost installation on CVM.

Open the terminal on the computer and log in to Tencent CVM as root via SSH. Be sure to replace the IP address of Tencent CVM.

ssh root@your_server_ip

If you are prompted to enter a password, please enter the password sent to you via email when you created the Tencent CVM, and then follow the prompts on the screen to change the temporary password. If you use SSH keys to set up Tencent CVM, the keys will be used for authentication.

Before we start working in a web browser, we will get the latest version and secure the site with SSL from the terminal.

Step 4-Get the latest version of Ghost

The Ghost project has developed rapidly, adding new features and ensuring the security of the software. In this step, we will ensure that we have the latest version.

To manage Ghost, we need to be a ghost-mgr user, so we will switch to it with the following command:

sudo -i -u ghost-mgr

Next, we will switch to the directory where Ghost is installed:

cd /var/www/ghost

Once here, we will run its update command:

ghost update

If an update is required, we will receive output similar to the following:

​
✔ Checking for latest Ghost version
✔ Downloading and updating Ghost to v1.9.0
Running sudo command: systemctl stop ghost_203-0-113-0
✔ Stopping Ghost
✔ Linking latest Ghost and recording versions
Running sudo command:-E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
[2017- 09- 2520:47:36] INFO Finished database migration!
✔ Running database migrations
✔ Validating config
Running sudo command: systemctl stop ghost_203-0-113-0
✔ Restarting Ghost
ℹ Removing old Ghost versions [skipped]

If Ghost is up to date, we will receive confirmation:

✔ Checking system Node.js version
✔ Checking current folder permissions
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking for available migrations
✔ Checking for latest Ghost version
All up to date!

In either case, when the script completes, we will return to the command prompt.

Step 5-Configure Ghost

Next, we want to make sure to encrypt our username and password when logging in to the website, so we will run Ghost's installation script. Some of the output is quite technical, so we will step through the script and guide you through the choices you need to make.

We first start by issuing the setup command in the /var/www/ghost directory:

ghost setup

We will enter the URL of our blog when answering the first question. Please be sure to enter your domain name:

Output? Enter your blog URL: http://blog.digitalocean.love

After that, we will be asked a few questions about [MySQL] (https://cloud.tencent.com/product/cdb?from=10680) and the database. These settings have been configured on our Tencent CVM, so we can accept the given values:

Output? Enter your MySQL hostname: localhost
? Enter your MySQL username: ghost
? Enter your MySQL password(skip to keep current password):[hidden]? Enter your Ghost database name: ghost_production
✔ Configuring Ghost
✔ Setting up instance
Running sudo command: chown -R ghost:ghost /var/www/ghost/content
✔ Setting up "ghost" system user

When the script asks about setting up a mysql user, one has already been set up, so we will enter n. :

ghost setup continuedDo you wish to set up "ghost" mysql user? n 

Next, in order to make our website production-ready, when we are prompted to set up Nginx, we will accept the default value, Y.

ghost setup continued? Do you wish to set up Nginx?(Y/n)Y

Once we say yes, the script will set up the configuration file:

Output✔ Creating nginx config file at /var/www/ghost/system/files/blog.digitalocean.love.conf
Running sudo command: ln -sf /var/www/ghost/system/files/blog.digitalocean.love.conf /etc/nginx/sites-available/blog.digitalocean.love.conf
Running sudo command: ln -sf /etc/nginx/sites-available/blog.digitalocean.love.conf /etc/nginx/sites-enabled/blog.digitalocean.love.conf
Running sudo command: nginx -s reload
✔ Setting up Nginx

The next choice we need to make is whether to set up SSL with Let's Encrypt.

Similarly, the default is "Yes". We can press ENTER or Y key to operate. After that, we will provide an email address to receive information about our security certificate.

? Do you wish to set up SSL? Y
? Enter your email(used for Let's Encrypt notifications)[email protected]

This script will provide feedback when our website is protected. It is normal for the certificate to be generated for a few minutes.

✔ Creating ssl security parameters file at /var/www/ghost/system/files/ssl-params.conf
✔ Creating ssl config file at /var/www/ghost/system/files/ghost.digitalocean.love-ssl.conf
Running sudo command: ln -sf /var/www/ghost/system/files/ghost.digitalocean.love-ssl.conf /etc/nginx/sites-available/ghost.digitalocean.love-ssl.conf
Running sudo command: ln -sf /etc/nginx/sites-available/ghost.digitalocean.love-ssl.conf /etc/nginx/sites-enabled/ghost.digitalocean.love-ssl.conf
Running sudo command: service nginx restart
✔ Setting up SSL

After setting up SSL, we will ask if we want to set up Systemd. This is already configured, so we will say No:

​
? Do you wish to set up Systemd? No
ℹ Setting up Systemd [skipped]
Running sudo command:-E -u ghost /usr/lib/node_modules/ghost-cli/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
[2017- 09- 2521:11:48] INFO Finished database migration!
✔ Running database migrations

Ghost is already running so we will say No to start it because we received an error.

? Do you want to start Ghost? No

We really need to restart it, so we will use the following command:

sudo systemctl restart ghost\*

At this point, we have completed the command line work, and we will switch to the web browser.

Step 6-Create a management account

In a web browser, we will visit the website to protect the administrative account of the website. No matter if the URL we enter starts with http:// or https://, we will be redirected to https://.

To enter the settings dialog box, please access the /ghost page by entering https://your_server_domain/ghost in the web browser:

From here, you can set up a management account in accordance with Ghost's workflow, after which you will have a fully working Ghost blog. You are ready to start using Ghost. In addition, we recommend that you follow our initial server setup guide to create a user with sudo permissions, lock root login, and take other steps to make your Tencent CVM ready for production.

**Note: **Whether you are managing Tencent CVM itself as a root user or using a sudo user as suggested in the "Initial Server Setup" guide, you always need to be the person who manages the installation of Ghost by becoming ghost-mgr:

sudo -i -u ghost-mgr

in conclusion

Tencent Cloud’s Ghost one-click application helps you start blogging with Ghost, and your Tencent CVM is set up to make it as easy as possible for you to take care of your blog for a long time.

There are many other options for customization with Ghost. See Ghost document for more information. Keep in mind that in some cases, such as when installing themes or upgrading, you may need to stop, start or restart Ghost.

For more Ubuntu tutorials, please go to [Tencent Cloud + Community] (https://cloud.tencent.com/developer?from=10680) to learn more.


Reference: "How To Set Up the DigitalOcean Ghost One-Click Application for Ubuntu 16.04"

Recommended Posts

How to set up Ghost one-click app for Ubuntu 16.04
How to set up vsftpd for anonymous downloads on Ubuntu 16.04
How to set up vsftpd for user directories on Ubuntu 16.04
How to set up Gogs on Ubuntu 14.04
How to set up R on Ubuntu 14.04
How to set up Shiny Server on Ubuntu 14.04
How to set up time synchronization on Ubuntu 18.04
How to set up a DNS server on Ubuntu 18.04
How to set up Java Home on Ubuntu and Raspbian
How to set up a Masterless Puppet environment on Ubuntu 14.04
How to set up a firewall with UFW on Ubuntu 14.04
How to set up a production Elasticsearch cluster on Ubuntu 14.04
How to set up an Apache virtual host on Ubuntu 16.04
How to set up an Apache virtual host on Ubuntu 20.04
How to set up password authentication with Nginx on Ubuntu 14.04
How to set static IP in ubuntu14.04
How to set PostgreSQL startup on Ubuntu 16.04
How to set static IP on Ubuntu 18.04 Server
How to set static IP on Ubuntu 18.04 Server
How to set up SSH keys on CentOS 8
Explain how to set static IP on ubuntu14.04
How to upgrade to Ubuntu 20.04
How to upgrade to Ubuntu 20.04
How to configure DNS for Ubuntu to make it permanent
Many attempts to set up soft routing in ubuntu
How to set a fixed IP based on Ubuntu 16.04
How to upgrade to Ubuntu 16.04 LTS
How to Run Tmux Service Scripts on Ubuntu Start Up
How to set up an Apache virtual host on CentOS 7
How to create LVM for XFS file system under Ubuntu
How to set or modify the time zone on Ubuntu 20.04
How to set or modify the time zone on Ubuntu 20.04
How to install Helm in Ubuntu
How to install Ruby on Ubuntu 20.04
How to install Java on Ubuntu 20.04
How to use hanlp in ubuntu
How to install VirtualBox on Ubuntu 20.04
How to install Elasticsearch on Ubuntu 20.04
How to install Protobuf 3 on Ubuntu
How to install Nginx on Ubuntu 20.04
How to install Apache on Ubuntu 20.04
How to install Git on Ubuntu 20.04
How to install Node.js on Ubuntu 16.04
How to install Vagrant on Ubuntu 20.04
How to install Bacula-Web on Ubuntu 14.04
How to install PostgreSQL on Ubuntu 16.04
How to install Git on Ubuntu 20.04
How to compile ijkplayer-android under ubuntu
How to install Anaconda3 on Ubuntu 18.04
How to install mysql in Ubuntu 14.04
How to install Memcached on Ubuntu 18.04
How to install Jenkins on Ubuntu 16.04
How to install MemSQL on Ubuntu 14.04
How to install Go on Ubuntu 20.04
How to install MongoDB on Ubuntu 16.04
How to install Mailpile on Ubuntu 14.04
How to install PrestaShop on Ubuntu 16.04
How to upgrade to PHP 7 on Ubuntu 14.04
How to install Skype on Ubuntu 20.04
How to install Jenkins on Ubuntu 20.04
How to install Python 3.8 on Ubuntu 18.04