What are clouds made of? Linux servers, mostly. Or, so goes the joke. In this video, learn what you'll need to consider when you set up Linux on a virtual private server (VPS).
- [Instructor] If you're learning about Linux or need a place to practice your skills, you might not have a dedicated workstation with a Linux installation. If so, a good choice for working with Linux is to use one of the cloud providers. Cloud providers run a virtual Linux machine in their data centers, one that can be left on or can be shut down when you're not using it to save resources and thus to save on costs. Many cloud providers off a free tier of pricing. That is, one with either limited resources or a limited period of time they won't charge you for.
In the next few episodes, we'll explore working with Linux on some common cloud providers. In this episode, I want to focus on Linux running on a VPS, or virtual private server in general. Sometimes you can get a VPS that's a pretty basic install and you have to take care of a lot of the other setup yourself. Other times you can deploy a virtual machine image that already has a lot of configuration taken care of. It might be configured as a web server, a database server, and so on. When you're setting up a VPS, there are a few general things that you want to keep in mind and take care of.
The first thing to be aware of is the amount of resources you'll need. This, of course, depends on what you plan to do with your server. You'll need to consider how much RAM, how many CPU cores, and how much storage your app or service will require. In many cases, you can change these attributes after the fact, but you should have a good idea of what you'll need before you start building a server. The next issue to consider is bandwidth. Some providers offer unlimited bandwidth and others limit the amount of data you can use, charging for any overages.
So if you'll be transferring a lot of data in or out of your server, that's something to consider. The next big item to think about is security. Frequently, virtual private servers have public IP addresses, meaning they're directly accessible on the internet. There's all kinds of things happening on the internet. Bad actors like nation states and various kinds of criminals look to exploit weaknesses in the security of devices and servers they find. So it's very important to make sure your server is as secure as it can be. Usually a hosting provider will have some level of security that they enforce on their network, but generally it's up to you to make sure your server has a properly-configured firewall, updated software, and that it follows best practices for remote access, like only allow SSH with a key instead of a password and perhaps using some kind of login-limiting software like fail2ban.
If someone compromises your server, you could be on the hook for bandwidth and other charges or some kind of liability. After these general guidelines come more specific ones. Depending on the software you'll need, you'll have to install it either from repositories or from source. And when you install software, you want to make sure it's updated and patched for known vulnerabilities. Many packages like MySQL come with scripts or configuration tools to harden them for production or public use. While some providers will apply critical security updates automatically, it's your responsibility to check for and install any other available updates.
Getting files to and from your server is also something you'll need to consider. If you're building an application or something involving source code, source control management software like Git is a good option. Save locally, commit, and then pull from your server. If you need to move individual files around, you can use SCP, the secure copy function offered by SSH or you could use something like Rsync to keep a synced copy of a folder up to date. If you're concerned about breaking something and if it's not too expensive, you might also look into periodically snapshotting your server and storing snapshots in case you need to rollback a change.
Snapshots aren't backups though, and servers should never have any data that isn't backed up or easily reproducible. Be sure you have a backup strategy for your data and put your configurations into configuration management software or at least document your configuration in case you need to reproduce it or troubleshoot something. Virtual private servers are an excellent way of running a Linux machine that needs to provide services to other or it needs to be always accessible if you're on the go.
Note: Because this is an ongoing series, viewers will not receive a certificate of completion.