<\/span><\/h2>\n\n\n\nTo install the Nginx web server execute the following command:<\/p>\n\n\n\n
sudo apt-get install nginx -y<\/pre>\n\n\n\nAfter successful installation, the Nginx service will be automatically started. To check the status of Nginx, execute the following command:<\/p>\n\n\n\n
sudo systemctl status nginx<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# sudo systemctl status nginx\n\u25cf nginx.service - A high performance web server and a reverse proxy server\n Loaded: loaded (\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: enabled)\n Active: active (running) since Wed 2022-12-28 15:27:57 CST; 10s ago\n Docs: man:nginx(8)\n Process: 8663 ExecStartPre=\/usr\/sbin\/nginx -t -q -g daemon on; master_process on; (code=exited, status=0\/SUCCESS)\n Process: 8664 ExecStart=\/usr\/sbin\/nginx -g daemon on; master_process on; (code=exited, status=0\/SUCCESS)\n Main PID: 8760 (nginx)\n Tasks: 4 (limit: 4575)\n Memory: 4.8M\n CPU: 50ms\n CGroup: \/system.slice\/nginx.service\n<\/pre>\n\n\n\n<\/span>Step 3. Install MySQL server<\/span><\/h2>\n\n\n\nTo install MySQL execute the following command:<\/p>\n\n\n\n
sudo apt install mysql-server -y<\/pre>\n\n\n\nOnce installed, start and enable the MySQL service:<\/p>\n\n\n\n
systemctl start mysql.service && systemctl enable mysql.service<\/pre>\n\n\n\nTo check the status of the service:<\/p>\n\n\n\n
systemctl status mysql.service<\/pre>\n\n\n\nIf everything is ok, you should get the following output:<\/p>\n\n\n\n
root@host:~# systemctl status mysql.service\n\u25cf mysql.service - MySQL Community Server\n Loaded: loaded (\/lib\/systemd\/system\/mysql.service; enabled; vendor preset: enabled)\n Active: active (running) since Wed 2022-12-28 15:32:20 CST; 13s ago\n Main PID: 9547 (mysqld)\n Status: \"Server is operational\"\n Tasks: 39 (limit: 4575)\n Memory: 364.1M\n CPU: 1.258s\n CGroup: \/system.slice\/mysql.service\n \u2514\u25009547 \/usr\/sbin\/mysqld\n<\/pre>\n\n\n\n<\/span>Step 4. Create a Ghost database and user<\/span><\/h2>\n\n\n\nNext, we need to create a Ghost database, the Ghost user, and grant the permissions for that user to the database.<\/p>\n\n\n\n
CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';\n CREATE DATABASE ghost;\n GRANT ALL PRIVILEGES ON ghost.* TO 'ghost'@'localhost';\n FLUSH PRIVILEGES;\n EXIT;\n<\/pre>\n\n\n\n<\/span>Step 5. Install Nodejs and npm<\/span><\/h2>\n\n\n\nTo install nodejs and npm, execute the following commands:<\/p>\n\n\n\n
curl -sL https:\/\/deb.nodesource.com\/setup_16.x | sudo -E bash\n\nsudo apt-get update\n\nsudo apt-get install nodejs\n\nsudo npm install npm@latest -g<\/pre>\n\n\n\nYou can check the versions of Nodejs and NPM with the following command:<\/p>\n\n\n\n
node --version && npm --version<\/pre>\n\n\n\nYou will get the following output:<\/p>\n\n\n\n
root@host:~# node --version && npm --version\nv16.19.0\n9.2.0\n<\/pre>\n\n\n\n<\/span>Step 6. Install Ghost-CLI and Ghost<\/span><\/h2>\n\n\n\nFirst, we need to install the Ghost client command line tool, so we can install Ghost later:<\/p>\n\n\n\n
sudo npm install -g ghost-cli@latest<\/pre>\n\n\n\nTo check the Ghost client version, execute the following:<\/p>\n\n\n\n
ghost -v<\/pre>\n\n\n\nYou will get the following output:<\/p>\n\n\n\n
Ghost-CLI version: 1.23.1<\/pre>\n\n\n\nNow, when we have all dependencies installed, we can finally install Ghost. To create a Ghost user:<\/p>\n\n\n\n
adduser ghostuser\n\nusermod -aG sudo ghostuser\n\n<\/pre>\n\n\n\nLogin with the newly created Ghost user, create a ghost directory, and set the right permission:<\/p>\n\n\n\n
su - ghostuser\n\nsudo mkdir -p \/var\/www\/ghost\n\nsudo chown ghostuser:ghostuser \/var\/www\/ghost\n\nsudo chmod 775 \/var\/www\/ghost\n\n<\/pre>\n\n\n\nGo into the Ghost directory and install Ghost with the following command:<\/p>\n\n\n\n
cd \/var\/www\/ghost\/\n\nghost install<\/pre>\n\n\n\nThe installation will start, and you will be asked to specify the domain name, MySQL host, database name, database user, password and to confirm the Nginx web server, SSL certificate and etc.<\/p>\n\n\n\n
\u2714 Checking system Node.js version - found v16.19.0\n\u2714 Checking logged in user\n\u2714 Checking current folder permissions\n\u2714 Checking system compatibility\n\u2714 Checking for a MySQL installation\n\u2714 Checking memory availability\n\u2714 Checking free space\n\u2714 Checking for latest Ghost version\n\u2714 Setting up install directory\n\u2714 Downloading and installing Ghost v5.26.3\n\u2714 Finishing install process\n? Enter your blog URL: http:\/\/yourdomain.com<\/b>\n? Enter your MySQL hostname: localhost<\/b>\n? Enter your MySQL username: ghost<\/b>\n? Enter your MySQL password: [hidden]<\/b>\n? Enter your Ghost database name: ghost<\/b>\n\u2714 Configuring Ghost\n\u2714 Setting up instance\n+ sudo useradd --system --user-group ghost\n+ sudo chown -R ghost:ghost \/var\/www\/ghost\/content\n\u2714 Setting up \"ghost\" system user\n\u2139 Setting up \"ghost\" mysql user [skipped]\n? Do you wish to set up Nginx? Yes<\/b>\n+ sudo mv \/tmp\/yourdomain-com\/yourdomain.com.conf \/etc\/nginx\/sites-available\/yourdomain.com.conf\n+ sudo ln -sf \/etc\/nginx\/sites-available\/yourdomain.com.conf \/etc\/nginx\/sites-enabled\/yourdomain.com.conf\n+ sudo nginx -s reload\n\u2714 Setting up Nginx\n? Do you wish to set up SSL? (Y\/n) Y<\/b>\n? Enter your email (For SSL Certificate) admin@yourdomain.com<\/b>\n+ sudo mkdir -p \/etc\/letsencrypt\n+ sudo .\/acme.sh --install --home \/etc\/letsencrypt\n+ sudo \/etc\/letsencrypt\/acme.sh --issue --home \/etc\/letsencrypt --server letsencrypt --domain yourdomain.com --webroot \/var\/www\/ghost\/system\/nginx-root --reloadcmd \"nginx -s reload\" --accountemail admin@yourdomain.com\n+ sudo openssl dhparam -dsaparam -out \/etc\/nginx\/snippets\/dhparam.pem 2048\n+ sudo mv \/tmp\/ssl-params.conf \/etc\/nginx\/snippets\/ssl-params.conf\n+ sudo mv \/tmp\/yourdomain-com\/yourdomain.com-ssl.conf \/etc\/nginx\/sites-available\/yourdomain.com-ssl.conf\n+ sudo ln -sf \/etc\/nginx\/sites-available\/yourdomain.com-ssl.conf \/etc\/nginx\/sites-enabled\/yourdomain.com-ssl.conf\n+ sudo nginx -s reload\n\u2714 Setting up SSL\n? Do you wish to set up Systemd? (Y\/n) Y<\/b>\n? Do you wish to set up Systemd? Yes\n+ sudo mv \/tmp\/yourdomain-com\/ghost_yourdomain-com.service \/lib\/systemd\/system\/ghost_yourdomain-com.service\n+ sudo systemctl daemon-reload\n\u2714 Setting up Systemd\n+ sudo systemctl is-active yourdomain-com\n? Do you want to start Ghost? Yes<\/b>\n+ sudo systemctl start ghost_yourdomain-com\n\u2631 Starting Ghost\nGhost uses direct mail by default. To set up an alternative email method read our docs at https:\/\/ghost.org\/docs\/config\/#mail\n\n------------------------------------------------------------------------------\n\nGhost was installed successfully! To complete setup of your publication, visit:\n\n http:\/\/yourdomain.com\/ghost\/<\/b>\n<\/pre>\n\n\n\n After successful installation, you can access the website at http:\/\/yourdomain.com\/ghost\/<\/b> to define the name of the website and set up the login credentials.<\/p>\n\n\n\n
<\/figure><\/div>\n\n\n<\/p>\n\n\n\n
Once done, click on the black button “Create account & start publishing -><\/b>“<\/p>\n\n\n\n
<\/figure><\/div>\n\n\n<\/p>\n\n\n\n
That’s it; you successfully installed and configured Ghost on Ubuntu 22.04. Of course, you do not have to do this if you find the setup complex. You can always contact our Technical support. We are available 24\/7 and will help you with any Ghost installation and configuration aspect.<\/p>\n\n\n\n
If you liked this about installing Ghost on Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"
Ghost is a free and open-source content management system (CMS) used for hosting a website. It is mainly used for … <\/p>\n
Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":45157,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1710,1236,13],"tags":[313,1603,2012],"yoast_head":"\nHow to Install Ghost on Ubuntu 22.04 - RoseHosting<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n \n \n \n \n\t \n\t \n\t \n