{"id":4726,"date":"2016-03-01T04:12:29","date_gmt":"2016-03-01T10:12:29","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=4726"},"modified":"2022-06-03T03:43:46","modified_gmt":"2022-06-03T08:43:46","slug":"install-ghost-on-ubuntu-14-04","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-ghost-on-ubuntu-14-04\/","title":{"rendered":"Install Ghost on Ubuntu 14.04"},"content":{"rendered":"
In this blog post we will show you how to install Ghost on an Ubuntu 14.04 VPS with the latest version of Nginx. Ghost is a new exciting blogging platform built on Node.js. The Ghost user interface is very simple and straightforward making it great for beginners as well as advanced users.This guide should work on other Linux VPS<\/a> systems as well but was tested and written for Ubuntu 14.04 VPS<\/a>. We will install the latest nodejs package from Chris Lea’s repo<\/p>\n Change into the ~\/myGhostBlog directory and install Ghost.<\/p>\n When the installation is finished, run the following to start Ghost in development mode:<\/p>\n If you see the below message, it means you’ve successfully installed Ghost.<\/p>\n Stop the process with The latest version of Nginx 1.6.2 is not available via the default Ubuntu repositories, so we will add the “nginx\/stable” PPA, update the system and install the nginx package.<\/p>\n Create a new Nginx server block with the following content<\/p>\n Test the Nginx configuration and restart the server<\/p>\n You can now start, stop and restart your Ghost instance with<\/p>\n That’s it. Now open your browser, type the address of your website, e.g. For more information about how manage your Ghost blog, please refer to the Ghost website.<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Fully-Managed Ubuntu Hosting<\/a> services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS<\/span><\/strong>. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this blog post we will show you how to install Ghost on an Ubuntu 14.04 VPS with the latest … <\/p>\n
\n<\/p>\nLog in to your VPS via SSH<\/h4>\n
ssh myUsername@myVPS_IP<\/pre>\n
Update the system and install necessary packages.<\/h4>\n
root@vps:~# sudo apt-get update && sudo apt-get -y upgrade\nroot@vps:~# sudo apt-get install python-software-properties unzip wget<\/pre>\n
Install Node.js<\/h4>\n
root@vps:~# sudo add-apt-repository ppa:chris-lea\/node.js\nroot@vps:~# sudo apt-get update\nroot@vps:~# sudo apt-get install nodejs<\/pre>\n
Download and extract the latest Ghost version<\/h4>\n
root@vps:~# mkdir ~\/myGhostBlog\nroot@vps:~# wget https:\/\/ghost.org\/zip\/ghost-latest.zip\nroot@vps:~# unzip -d ~\/myGhostBlog ghost-latest.zip\nroot@vps:~# rm -f ghost-latest.zip\n<\/pre>\n
Install and Configure Ghost<\/h4>\n
root@vps:~# cd ~\/myGhostBlog\nroot@vps:~# npm install --production<\/pre>\n
root@vps:~# npm start<\/pre>\n
Ghost is running in development... \nListening on 127.0.0.1:2368 \nUrl configured as: http:\/\/my-ghost-blog.com<\/pre>\n
Control-C<\/code> and continue with the Nginx installation.<\/p>\n
Install and Configure Nginx<\/h4>\n
root@vps:~# sudo add-apt-repository ppa:nginx\/stable\nroot@vps:~# sudo apt-get update\nroot@vps:~# sudo apt-get install nginx<\/pre>\n
root@vps:~#sudo nano \/etc\/nginx\/conf.d\/myWebsite.com<\/pre>\n
server {\n server_name myWebsite.com;\n listen 80;\n\n access_log \/var\/log\/nginx\/myGhostBlog-access.log;\n error_log \/var\/log\/nginx\/myGhostBlog-error.log;\n\n location \/ {\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header Host $http_host;\n proxy_pass http:\/\/127.0.0.1:2368;\n }\n \n}\n<\/pre>\n
root@vps:~# sudo nginx -t\nroot@vps:~# sudo \/etc\/init.d\/nginx restart<\/pre>\n
Create an Upstart script<\/h4>\n
sudo nano \/etc\/init\/ghost.conf<\/pre>\n
start on runlevel [2345]\nstop on shutdown\n \nrespawn\nrespawn limit 5 60\n \nenv name=ghost\nenv uid=myUsername\nenv gid=myUsername\nenv daemon=\/usr\/bin\/node\nenv path=\/home\/myUsername\/ghost\/index.js\nexport NODE_ENV=production\n\nscript\nexec start-stop-daemon --start --make-pidfile --pidfile \/var\/run\/$name.pid --name $name -c $uid:$gid -x $daemon $path >> \/var\/log\/upstart\/$name.log 2>&1\nend script<\/pre>\n
service ghost stop \nservice ghost start \nservice ghost restart \n<\/pre>\n
http:\/\/myWebsite.com\/ghost <\/code>and create an admin user to log in to the Ghost.<\/p>\n
\n