This is the second in a series documenting our process to get off of third-party and closed information services. We want to control our data and as we learn more about taking over our organizational we’ll be sharing it. This post is about getting a VPS ready to host a website. After some useful feedback in the comment section for the last post, we have decided to move our VPS to another hosting provider (see comments in the last post for more information on that). We’re still using the Debian OS.
So now you have your Virtual Private Server, your operating system setup, and your very own IP address (if you don’t, here’s more on that from the last post). What’s the next step for connecting your newly minted server to the internet? For that you will need software. But to install software you need to log-in to your new server. So, fasten your seatbelts; and open your terminal interface (Terminal window for Mac; Command Prompt for Windows; and Linux users probably know the name of their command line interface).
Logging into your Server
The first step for getting ready to install the software is to log into your server using SSH (secure shell). This is basically a way to interact with your VPS from your computer. The command for this in Debian is:
ssh root@'your IP address here'
The command line will then ask you for your ssh password – the password you set up when you set up your VPS. Make sure this password is strong because. It is a primary defense of the information on your server. (Here’s why you need strong passwords, and how you can manage your passwords so you don’t have to remember them). After successfully entering your password, command line will spit out a block of text with details about what operating system your server is running. Once you are logged in, your terminal window will change slightly. The name to the right of the > bracket will go from the name of your computer to the name of your server (right now the name of your IP address). That is how you will always be able to tell that you are now operating your server from command line (and not your personal computer).
Installing Your First Piece of Software
Luckily, selecting web server software – the software the can sort requests for information from your website visitors – is pretty straightforward. I chose Apache for our server, based on a recommendation from a system administrator friend, but there are other web server applications out there (Nginyx is another option). The next blog post about configuring your server will be based on Apache. If you want a bit more information about the difference between the two, look here, or if you want to read more about how to run the two together, look here.
So, how to install new applications through command line? Luckily, once you get past the nervousness of dealing with your new command line interface, it’s clear that downloading is a lot more straightforward than in point-and-click interfaces. For Debian, we use “apt-get install” plus “the name of the application you want to install”. So for Apache, type in
apt-get install apache2
and the VPS takes care of the rest. For the official package name that command line will understand (i.e. apache2 for Apache) you can search here.
What is “apt-get”
What is this magical apt-get? Linux pulls from an existing library of packages (bundles of software) and what are called dependencies (things that are required to install so that another application can work properly). (More on this and how cool it is can be found here.) A lot of times when something isn’t working, command line will tell you that there is a dependency missing. As a rule of thumb, it’s also smart to run “apt-get update” before installing something new to make sure that all of your dependencies are up-to-date.
Dependencies you need to get started
To run websites that use .php, you will need to install dependencies for php (for a list, look here); for managing data, you’ll need MySQL (for commands to install MySQL look here; and for a quick introduction to set up users and databases in MySQL take a look here). Practice your apt-get install and get these dependencies installed on your VPS.
What’s up next?
Now that we have Apache2 installed (and hopefully you have MySQL and php too – we’ll need those later for things like collaborative documents and cloud file storage) the next post will be about configuring Apache so that you that when you visit your IP address, this is what you see: