Pinterest Stumbleupon Whatsapp
Ads by Google

So, you’ve chosen your domain name How Do You Pick A Great Domain Name? How Do You Pick A Great Domain Name? Choosing the perfect domain name for your website is like choosing the perfect name for your first child. Increase the likelihood of online success with these tips. There's a lot in a name! Read More . You have a killer idea for a project. You’re fired up, and ready to unleash your latest and greatest creation upon the internet.

After scouring the internet looking for the best web hosting, you’ve landed yourself a sweet deal on a VPS. There’s one problem though. You don’t know the first thing about operating Linux through its powerful command line.

Well, worry no more. I’m about to drop the know-how of how to install two incredible web applications. One is blogging-platform extraordinaire WordPress, which powers a huge swathe of the internet, including this very site. I’m also going to show you how to install the latest pretender to the blogging throne; the Javascript and Node powered Ghost. Once you’ve ran through the process of installing these apps, you should be confident enough with the Linux command line to tackle any web application that crosses your path.

To do that, I’ve span up a DigitalOcean instance running Ubuntu 13.10 x64. Digital Ocean are a VPS provider I’ve got a soft spot for; offering quality service and fast virtualized servers with a starting price of $5. I recommend them highly, although there are other VPS providers out there who are quite good.

Installing Ghost

Ghost is blogging, reimagined. Each iota of the experience has been designed to make the process of publishing your oeuvres that bit more painless. My colleague Mihir Patkar gave a run-down of Ghost Ghost Launches Javascript-Based Blogging Platform As Simple Alternative To Wordpress Ghost Launches Javascript-Based Blogging Platform As Simple Alternative To Wordpress Wordpress is more than just a blogging platform, but developer John O’Nolan wanted something simpler -- he wanted "just a blogging platform". And so he created Ghost, building it entirely on Javascript. Read More   a few months back.

Whilst we’re going to be installing Ghost on a Digital Ocean VPS – which comes with a Ghost installer – we’re going to ignore the installer and do this the hard way.

Ads by Google

First things first, we need to SSH into our box. This should be relatively straightforward if you run Linux or OS X, as they both come with an SSH client built in. Windows users are encouraged to check out PuTTY, which is a pretty incredible, open source SSH client, although there are a number of incredible alternatives 4 Easy Ways to Use SSH In Windows 4 Easy Ways to Use SSH In Windows SSH is the de facto solution for securely accessing remote terminals on Linux and other UNIX-like systems. If you have a remote SSH server you want to access, you'll have to download an SSH client.... Read More , including ones which plug into your web browser.

ssh-ghost-connect

If we’re logging into our box for the first time, we’re going to have to do a bit of housekeeping first. We’re going to make sure that the package manager is updated and if there are any updates to our system, we should install them. In Ubuntu, this is done by inputting the following commands:

sudo apt-get update
sudo apt-get upgrade

Note that if you’ve logged in as Root, you won’t need to write ‘sudo’. Sudo is used for accounts to temporarily escalate their privileges in order to perform a command which affects the underlying operating system.

ssh-ghost-update

ssh-ghost-upgrade

Now, grab a copy of build-essential and zip.

sudo apt-get install build-essential zip

This is the third time we’ve had to use a command which does something with apt-get. So, what is it? Apt-get is the package manager used in Debian, Ubuntu and Linux Mint Your Guide to Ubuntu Repositories and Package Management Your Guide to Ubuntu Repositories and Package Management Read More . It allows us to keep track of all the packages on your system and install new ones, as well as delete and update them. Cool, right?

ssh-ghost-build

Oh, and while you’re at it, grab a copy of Node.js. This is the platform upon which What is Node.JS and Why Should I Care? [Web Development] What is Node.JS and Why Should I Care? [Web Development] JavaScript is a just a client-side programming language that runs in the browser, right? Not any more. Node.js is a way of running JavaScript on the server; but it's so much more as well. If... Read More Ghost runs, and can be grabbed with a simple apt-get. Users of older versions of Ubuntu might have to grab the copy of Node from Chris Lea’s PPA, which is more current than the official Ubuntu repos.

sudo apt-get install nodejs

ssh-ghost-node

You also need the Node Package Manager (NPM). Create a symbolic link between /usr/bin/nodejs and /usr/bin/node, grab the NPM installer and run it.

ln -s /usr/bin/nodejs /usr/bin/node
curl https://npmjs.org/install.sh | sudo sh

This is the first time we’ve came across curl. It’s actually a pretty cool utility for Linux which allows us to transfer data between programs. In this example, we’re using it to grab a copy of the NPM install script. This is then executed with ‘| sudo sh’.

ssh-ghost-symbolic

ssh-ghost-npm

Before we go any further, let’s verify that we’ve got Node and NPM installed. If your screen looks a bit like mine, feel free to proceed onwards.

npm -v
node -v

If you see an error, something went wrong. Try revisiting the earlier steps, or dropping me a comment below.

ssh-ghost-verify

Awesome. Now, let’s grab Ghost and open it up!

curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
unzip -uo ghost.zip -d ghost

ssh-ghost-grab

ssh-ghost-unzip

If you’re not already in it, switch into the Ghost directory and install it using NPM.

cd ghost/
npm install --production

ssh-ghost-switch

ssh-ghost-npm-install

Here’s a cool thing about NPM. It actually installs all the Javascript dependencies for Ghost for you. Awesome, right? Once it’s finished doing all the hard work, open up config.js and edit the port number to 8080 with your text editor of choice. Nano is a great choice for beginners nano vs. vim: Terminal Text Editors Compared nano vs. vim: Terminal Text Editors Compared Although Linux has become easy enough for practically anyone to use without ever having to use the Terminal, there are some of us who regularly use it or are curious about how one can control... Read More , although I’m rather fond of Vim. You’ll also need to change the hostname to the IP address of the server you are connecting to.

ssh-ghost-text-edit

Now, it’s time to start Ghost up! In the directory which you installed Ghost, run:

npm start

To check if this works, navigate to the server you installed Ghost on with your web browser, ensuring that it has the port number which you specified in config.js.

ssh-ghost-final

Huzzah! It works!

WordPress

Now, time to install WordPress. We’re going to start from scratch here with a fresh Digital Ocean droplet. As before, SSH into your server, update the package manager and install all updates. Once you’ve done that, we’re going to start off by creating our LAMP stack The Best Linux Web Server Software (& Apache Alternatives) The Best Linux Web Server Software (& Apache Alternatives) Read More . This stands for ‘Linux, Apache, MySQL and PHP’, and refers to the platform, web server, database and programming language used to run our installation of WordPress.

Getting your LAMP stack set up is easier than it sounds. Admittedly, there’s a small laundry-list of dependencies you have to install. Fortunately, Ubuntu comes with a nice one-liner which handles everything for you.

sudo apt-get install lamp-server^

ssh-wordpress-lamp

Your MySQL server is where you store all of your data. As a result, you are strongly advised to create a strong root password for your server when prompted.

ssh-wordpress-mysql-password

And that’s it. Seriously. That’s totally it. You’ve now set up your LAMP server. Now to install WordPress!

We first need to create the table in which WordPress A Step-by-Step MySQL Tutorial For Self-Hosted Wordpress Bloggers A Step-by-Step MySQL Tutorial For Self-Hosted Wordpress Bloggers If you’re a blogger, the chances are that you use WordPress. There are two ways in which you can use WordPress, ideal for those with some technical know-how and those without. The first is to... Read More will store our blog posts, as well as the database user which WordPress will use to interact with the database. Log in to MySQL.

ssh-wordpress-mysql-login

Now, run the following lines of code. Take care to enter each line individually.

CREATE DATABASE wordpress;
CREATE USER ‘wordpressuser’@‘localhost’ identified by ‘password’;
GRANT ALL PRIVILEGES ON wordpress. * TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
exit

Now, download and unzip WordPress.

wget http://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz -C /wordpress

Notice how we used wget here instead of curl? Either work, in this instance and are pretty much interchangeable. Within this context, they are both doing the same thing, more or less.

ssh-wordpress-download

Move WordPress to /var/www and grant read, write and execute permissions to this directory. Take care to include the -R flag. This makes it recursive.

mv wordpress/ /var/www
chmod -R 777 /var/www

ssh-wordpress-move

Now, in your browser, navigate to <ip address>/wordpress. If you’ve followed these instructions, you should see this page. You’ll then be required to create a configuration file using the web interface. Follow the instructions provided, and soon enough you’ll have your very own WordPress installation. Sweet, eh?

ssh-wordpress-config

What about Bitnami?

Before we finish up, I want to talk briefly about Bitnami. If you’re rocking an AWS 4 Great Uses for Amazon's S3 Web Services 4 Great Uses for Amazon's S3 Web Services Despite Amazon being most well known for their retail services, they actually offer a host of web services for developers and home users that take advantage of Amazons experience and scalability with massive amounts of... Read More  server, this is definitely something you should investigate. This Spanish startup makes it easy to remotely deploy popular web applications to your AWS slice, including Drupal WordPress vs. Drupal - Content Management Systems WordPress vs. Drupal - Content Management Systems Read More  and WordPress.

ssh-bitnami

If that sounds like too much hassle, you can even get Bitnami BitNami : Open Source Packages. Simplified. BitNami : Open Source Packages. Simplified. Read More  to sort you out with a server. Just expect to pay a slight premium for this.

I’m not going to look too much into this, as it’s a bit platform specific. However, if you’re desperate to give them a try, they offer free 1 hour installations of your web-application of choice. As for the rest of this article, what I’m going to discuss should work on any server running GNU/Linux.

Conclusion

The Linux command line can be intimidating at first. There’s no doubt about that. If you’ve accidentally found yourself saddled with SSH-only web hosting, you’re going to have to get your feet wet with the command line in order to get anything done.

Fortunately, if you can install one web app, you can install them all. All you need is a bit of confidence with the Linux command line, and the ability to google whatever problems crop up.

Have you ever signed up for SSH only web hosting by accident? I’d love to hear all about it. Drop me a comment below.

Photo Credit: Innovation Trends in Data Center Technology Think Tank (Dell)

  1. Vpshosting I
    February 20, 2014 at 6:29 am

    Thanks Matthew. Your explanation is really appreciable. I am also using VPS hosting from Trijit. And I am feeling good.
    Your article has made me more comfortable to use of it.

  2. Rob
    February 17, 2014 at 12:26 am

    Thanks for putting this together, Matt. I have a friend who's been mentioning doing something similar recently so he can run his own blog, though he ain't too techy. I'll be sending over some link love to this article :)

    • Matthew H
      February 17, 2014 at 10:42 am

      Thanks Rob. I really appreciate it!

  3. sneakily1
    February 17, 2014 at 12:02 am

    Great explanation, I'm looking into diving into the VPS world, but I'm used to cPanel... I've noticed a lot of VPS services offer it, but charge a premium. I've read (on here) that there's some free alternatives that are quite similar, and have read about a few of them. Any chance of getting you to do an article on how to get something like that up and running on a VPS, specifically through digital ocean (who I'll probably end up using).

    • Matthew H
      February 17, 2014 at 10:41 am

      Hey Sneakily1,

      Just so I fully understand, are you asking about how one could install an alternative to cPanel (such as the imaginatively named zPanel or Kloto) on a VPS?

    • sneakily1
      February 18, 2014 at 12:19 am

      Yes, I probably could have worded my request a little better. Kind of a VPS for Dummies who are spoiled with the convenience of shared hosting shortcuts. Any tips to help someone like me feel more at home once I've setup a droplet.

Leave a Reply

Your email address will not be published. Required fields are marked *