Create, Build, Test Drive, or Deploy Your Very Own Linux Server with Full Root Access

We’ve covered four ways to get access to a Linux shell account, but most of those methods do not allow you to run commands as the superuser, also known as root. You can learn a lot with a normal user account, but if you want to start getting into the system administration aspects of Linux you’ll want to have complete control over an entire server or set of servers. Below are some strategies for doing just that.

Create a Virtual Machine Using Vagrant and VirtualBox

Vagrant allows you to easily create virtual machines with just a few commands. The idea behind vagrant is that you can create reproducible work environments that are disposable. This is great for learning Linux because it allows you to quickly create a virtual machine on which you can experiment. When you are ready to start over, discard the current image with vagrant destroy and recreate a pristine one with vagrant up.

Linux root command line shell.
Got root?

To get started, head over to the VirtualBox download page and grab the installer for your current operating system. Click through the installation screens and accept the defaults. Here’s a video that walks you through the process. Next, download a copy of Vagrant by visiting the Vagrant download page. Install it using the normal procedures for your operating system.

You will need to download an image to use with Vagrant and VirtualBox. Vagrant calls these images “boxes.” You can find a list of boxes at https://app.vagrantup.com/boxes/search. You can add, remove, and list boxes with the vagrant box command. The format of the command to add a box is vagrant box add NAME URL.

Here is how you can download Ubuntu and CentOS boxes, for example.

$ vagrant box add ubuntu/focal64
==> box: Loading metadata for box 'ubuntu/focal64'
    box: URL: https://vagrantcloud.com/ubuntu/focal64
==> box: Adding box 'ubuntu/focal64' (v20220419.0.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/ubuntu/boxes/focal64/versions/20220419.0.0/providers/virtualbox.box
Download redirected to host: cloud-images.ubuntu.com
==> box: Successfully added box 'ubuntu/focal64' (v20220419.0.0) for 'virtualbox'!
$ vagrant box add centos/8
==> box: Adding box 'centos/8' (v2011.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/centos/boxes/8/versions/2011.0/providers/virtualbox.box
Download redirected to host: cloud.centos.org
    box: Calculating and comparing box checksum...
==> box: Successfully added box 'centos/8' (v2011.0) for 'virtualbox'!
$ vagrant box list
ubuntu12.04 (virtualbox)
centos/8                    (virtualbox, 2011.0)
ubuntu/focal64              (virtualbox, 20220419.0.0)

Vagrant makes it easy to create a virtual machine, start it, and connect to it.

$ mkdir temp-box
$ cd temp-box
$ vagrant init ubuntu/focal64
$ vagrant up
$ vagrant ssh

Vagrant comes with out of the box support for VirtualBox, but it can provision machines on other backend services as well. You can use vagrant with Amazon Web Services (AWS), Rackspace, DigitalOcean, and others by installing the corresponding vagrant provider plugin.

Spin up a Cloud Instance

With cloud computing providers, you can pick a pre-installed Linux image and launch an instance of that image. Instance is the cloudy way of saying virtual machine or server. One of the advantages of using a cloud provider is that you pay as you go. Traditional hosting services typically require you to pay for services in monthly increments. If you only need access to a server for a few hours a month, it is probably cheaper to use a cloud provider. Some providers charge by the minute like Rackspace and others charge by the hour like Amazon Web Services.

Here is a short list of popular cloud providers.

Use a Live Linux Distribution

Live Linux distributions give you the opportunity to try out Linux without having to modify your current system in any way. Just pop in the bootable CD, DVD, or USB drive and watch it run. Don’t use live distros to evaluate how Linux will perform on your hardware, though. Live images run in memory and also have to access a way-slower-than-your-hard-drive storage device. If you find that you like the distribution, you can choose to install it on your hard drive.

Here are a few Live Linux distros to get you started.

Install Linux the Old-Fashioned Way

So far we’ve been looking at ways to create Linux servers without having to manually install them. However, installing Linux by hand can be a rewarding experience. It gives you the opportunity to see what decisions need to be made when deploying a server. You can choose the partitioning scheme, the file system types, the file system sizes, and even decide what software packages will be installed on your system. Having control over the installation process can allow you to create a customized Linux server that fits your needs.

Here are a couple of guides that provide step-by-step instructions on installing Linux complete with screenshots. Find some hardware or create a virtual machine and have fun installing Linux.

Now that you have your own Linux server, you’ll need a way to connect to it over the network. For that, see the “21 Windows SSH Clients You Can Use to Connect to Your Linux Server” article.