Community Curriculum

Making Servers Work: A Practical Guide to Linux System Administration

By Topic

Table of Contents

This curriculum is designed to fill a gap in the existing literature about system administration. Many existing resources focus solely on theory, and others focus too specifically on the nuances of system utilities and services. Anyone who is interested in technology can benefit from learning about system administration. This curriculum highlights practical sysadmin skills, common architectures that you’ll encounter, and best practices that apply to automating and running systems at any scale, from one laptop or server to 1,000 or more.

1. Introductory Topics

  • The first section of this curriculum will familiarize you with Linux fundamentals. You will learn how to interact with a Linux server using the command line. Once you are connected to a Linux system using a command line client, you will learn how to find your way around a server and view and edit files.

    This section will also explain how to manipulate input and output to and from programs so that you can send output to log files, or automate input to programs. The final portion of this section explains how to manage users and permissions on files so that you can allow or restrict access based on a user’s role.

  • tutorial

    An Introduction to the Linux Terminal

    In this tutorial you will learn how to interact with a Linux system using commands and a terminal emulation program. This tutorial will discuss terminal options for Windows, macOS, and Linux, so you will be able to use any operating system to interact with a Linux server.

    After explaining what terminals are, this tutorial discusses the shell environment with a focus on the Bourne-Again shell (usually referred to as bash).

    From there, you will learn about the command prompt on a remote server. More specifically, you will learn how the command prompt is structured to provide you information about the server and how it lets you enter commands. You’ll also learn about tools like ls and how arguments to command line programs work.

    Finally, this tutorial explores environment variables, and how you can use them in your command prompt to do things such as creating references to installed applications, setting up default paths to libraries, and defining custom values that can be invoked later using the command line.

    Go to tutorial
  • tutorial

    Basic Linux Navigation and File Management

    This tutorial will introduce you to the primary tools that you can use to navigate filesystems and manipulate files on a Linux server. You will learn about the shell prompt and how to interact with it by invoking commands and programs. The programs that are demonstrated in this tutorial are some of the most important and commonly used command line tools on a Linux server.

    To start off you will learn how to display where you are located in a filesystem using the pwd command. You will learn how to list the contents of a directory with the ls command, and then how to navigate between directories using the cd command.

    After getting acquainted with how to navigate around a Linux system, you will learn how to create and view files using the touch and less commands respectively. You will also learn how to create and remove directories, and view and edit files.

    Go to tutorial
  • tutorial

    An Introduction to Linux Permissions

    In this tutorial you will learn about users and groups, file ownership, and permissions. These three concepts act in tandem to ensure security on a Linux system. To begin you will learn about users and groups on a system, since both ownership and permissions apply to files based on a user or group role.

    Once you are familiar with users and groups, the tutorial explains how to view who owns a file, and determine what permissions it has (its mode). The way that permissions are displayed and configured in Linux may be unfamiliar to some, so the tutorial explains how to understand file modes in some detail with examples of common modes that you are likely to encounter.

    Go to tutorial
  • tutorial

    An Introduction to Linux I/O Redirection

    This tutorial will introduce you to input and output streams on a Linux system. You will learn about the three standard stream systems: Standard Input, Standard Output, and Standard Error. You will also learn how to interact and redirect the contents of a stream to or from another stream or file. Once you are familiar with how streams work, you will learn how to use pipes and filters with stream data in order to process input or output using various command line tools.

    Go to tutorial
  • tutorial

    Initial Server Setup with Ubuntu 18.04

    In this tutorial you will learn about some of the common setup tasks that you should complete when you create a new Linux server. Specifically, you will learn how to log in as the root user using SSH, and then create an unprivileged user that you can use for most tasks. After you create a new user, you will learn how to grant administrative privileges so that the user can run commands with elevated system permissions.

    Once you have a new user with administrative access in place, you will learn how to set up a firewall to restrict traffic to specific services from the public Internet. Finally, you will learn how to ensure that any new unprivileged users that you create can use SSH to connect to a server.

    Go to tutorial
  • tutorial

    How to Add and Delete Users on Ubuntu 18.04

    In this tutorial you will learn how to manage users on a Linux system. You will add a user to a server, grant it access to run privileged commands using sudo, and then delete the user. This tutorial will also explain how to verify the privileges that are granted to a user with the sudo command.

    Go to tutorial

2. LAMP and LEMP Technology Stacks

  • The previous section covered Linux fundamentals and how to navigate and configure a server. This section will demonstrate how to install web servers and application stacks by using two popular web servers, Apache and Nginx.

    By the end of this section you will have a complete Linux, Apache, MySQL, and PHP (LAMP) stack, or Linux, Nginx, MySQL, and PHP (LEMP) stack configured to run and host a PHP based application.

    While the LAMP and LEMP stacks can also include support for programming languages like Python and Perl, these tutorials will focus on PHP since it is the most common language that you will encounter when starting out with system administration.

  • tutorial

    How To Install the Apache Web Server on Ubuntu 18.04

    This tutorial explains how to install and manage the Apache web server. Apache is the most widely used web server on the Internet, so it is relevant to learn how to install and configure it. In this tutorial you will learn how to install Apache, how to configure firewall rules to allow it to send and receive HTTP data, and how to verify that the server is configured correctly.

    You will also learn how to manage the Apache process, build more advanced VirtualHost configurations, and where to look and how to modify other important Apache configuration files and directories.

    Go to tutorial
  • tutorial

    How To Install Nginx on Ubuntu 18.04

    In the previous tutorial you learned how to install the Apache web server. This tutorial explains how to install and manage the Nginx web server, a fully featured alternative to Apache that powers some of the busiest websites in the world. In this tutorial you will learn how to install Nginx, how to configure firewall rules to allow it to send and receive HTTP data, and how to verify that the server is configured correctly.

    You will also learn how to manage the Nginx process, build more advanced server configurations, and where to look and how to modify other important Nginx configuration files and directories.

    Go to tutorial
  • tutorial

    How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04

    This tutorial explains how to set up a Linux, Apache, MySQL, and PHP server, commonly referred to as the LAMP stack. In this tutorial you will learn how to install all the required LAMP packages, create an Apache configuration, secure MySQL, set up the UFW firewall to allow traffic to the server, and finally add a test PHP script to demonstrate that all the components of the LAMP stack are working correctly.

    Go to tutorial
  • tutorial

    How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 18.04

    This tutorial explains how to set up a Linux, Nginx, MySQL, and PHP server, commonly referred to as the LEMP stack. In this guide you will learn how to install all the required LEMP packages, create an Nginx configuration, secure MySQL, set up the UFW firewall to allow traffic to the server, and finally add a test PHP script to demonstrate that all the components of the LEMP stack are working correctly.

    Go to tutorial

3. Securing your Servers

  • The previous section described how to install and configure LAMP and LEMP stacks. With either stack, you can run HTTP based applications that are available on the Internet for users. However, by default neither stack protects user logins or their web traffic from eavesdropping or tampering without some additional work.

    This section explains how to configure each LAMP and LEMP stack with TLS certificates for encrypted web traffic. Any incoming or outgoing HTTP requests to your server will be encrypted with TLS in place. Additionally, you will learn how to configure the built in firewall on a Linux server, so that only traffic that you allow will be able to reach your servers.

  • tutorial

    How To Secure Apache with Let's Encrypt on Ubuntu 18.04

    In this tutorial you will learn how to secure Apache using TLS/SSL certificates that are issued by Let’s Encrypt and managed with Certbot. By the end of this tutorial you will have an Apache web server set up with a VirtualHost for a custom domain that is secured using TLS/SSL encryption. You will also configure the certificate to renew automatically every ninety days using Certbot.

    Go to tutorial
  • tutorial

    How To Secure Nginx with Let's Encrypt on Ubuntu 18.04

    In this tutorial you will learn how to secure Nginx using TLS/SSL certificates that are issued by Let’s Encrypt and managed with Certbot. By the end of this tutorial you will have an Nginx web server set up with a server block for a custom domain that is secured using TLS/SSL encryption. You will also configure the certificate to renew automatically every ninety days using Certbot.

    Go to tutorial
  • tutorial

    How To Set Up a Firewall with UFW on Ubuntu 18.04

    In this tutorial you will learn how to set up a firewall with UFW on Ubuntu 18.04. UFW, or Uncomplicated Firewall, is an interface to iptables that removes much of the complexity of configuring firewall rules by hand.

    This tutorial explains how to enable UFW and how you can create, modify and delete firewall rules. It also demonstrates how to use UFW with IPv6 enabled network interfaces. By the end of this tutorial you will have a set of firewall rules that allows SSH traffic. You will also be able to add or remove rules for other kinds of traffic to and from servers.

    Go to tutorial

4. Automation with Ansible

  • In this section of the curriculum, you will revisit the initial server setup guide that you completed in Section 1. Instead of running commands manually, you will learn how to use Ansible, an automation tool, to configure your initial server.

    Once you are familiar with how to automate configuration steps, you will revisit the LAMP and LEMP stacks from Section 2. Again, instead of using SSH to connect to a server and install Apache/Nginx, MySQL, and PHP packages manually, you will learn how to automate these steps using Ansible. By the end of these tutorials, you will be able to configure either stack automatically on one, or as many new servers as you like.

  • tutorial

    How to Use Ansible to Automate Initial Server Setup on Ubuntu 18.04

    This guide explains how to use Ansible to automate setting up a Linux, Apache, MySQL, and PHP server, commonly referred to as the LAMP stack. It is a companion to the tutorial How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04.

    Go to tutorial
  • tutorial

    How to Use Ansible to Install and Set Up LAMP on Ubuntu 18.04

    This guide explains how to use Ansible to automate setting up a Linux, Apache, MySQL, and PHP server, commonly referred to as the LAMP stack. It is a companion to the tutorial How To Install Linux, Apache, MySQL, PHP (LAMP) stack on Ubuntu 18.04.

    Instead of manually running apt commands to set up the LAMP stack, this tutorial demonstrates how to use Ansible to configure a server. Ansible will install all the required LAMP packages, create and enable a new VirtualHost for Apache to use, secure MySQL, set up the UFW firewall to allow traffic to the server, and finally add a test PHP script to demonstrate that all the components of the LAMP stack are working correctly.

    Go to tutorial
  • tutorial

    How to Use Ansible to Install and Set Up LEMP on Ubuntu 18.04

    This guide explains how to use Ansible to automate setting up a Linux, Nginx, MySQL, and PHP server, commonly referred to as the LEMP stack. It is a companion to the tutorial How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 18.04.

    Instead of manually running apt commands to set up the LEMP stack, this tutorial demonstrates how to use Ansible to configure a server. Ansible will install all the required LEMP packages, create an Nginx configuration using a template, secure MySQL, set up the UFW firewall to allow traffic to the server, and finally add a test PHP script to demonstrate that all the components of the LEMP stack are working correctly.

    Go to tutorial
  • tutorial

    How To Acquire a Let's Encrypt Certificate Using Ansible on Ubuntu 18.04

    In this tutorial you will learn how to use Ansible to automate setting up Letsencrypt TLS certificate. This tutorial applies equally to LAMP and LEMP servers, so it is a companion to both previous tutorials on using Ansible to configure your LAMP and LEMP servers.

    Go to tutorial

5. Version Control and Continuous Integration

  • This last section of the curriculum will familiarize you with how to use Git for version control of server files, and to manage application code. Once you are familiar with using Git, the last set of tutorials will demonstrate how to install Jenkins to perform Continuous Integration (CI) with a Linux server.

  • tutorial

    How To Install Git on Ubuntu 18.04

    This guide explains how to install Git on an Ubuntu 18.04 server. It covers how to install Git using the default package that comes with Ubuntu, as well as how to install Git from source code. Once you have Git installed, the guide explains how to configure Git so that it knows your name and email address, which it uses in commit logs to track who changed a file or files.

    Go to tutorial
  • tutorial

    How To Use Git Effectively

    In this tutorial you will learn how to use Git to manage your workspace environment. You will also learn how to add an existing project to a git workspace. Once you are using Git with your project, this tutorial will explain how to create commit file changes to Git, along with how to add commit messages that annotate your changes. Finally, this tutorial explains how you can push changes to a remote server so that you can collaborate with others on a project.

    Go to tutorial
  • tutorial

    How To Install Jenkins on Ubuntu 18.04

    This tutorial demonstrates how to install Jenkins on a Linux server. Jenkins is a Continuous Integration tool that helps automate repetitive tasks like testing and deploying software. You will learn how to install Jenkins from the upstream Jenkins project’s software repository, and how to run it on a server. Once Jenkins is running, you’ll also learn how to configure the correct firewall rules to allow access to it, along with how to configure the administrative user and plugins.

    Go to tutorial
  • tutorial

    How To Configure Jenkins with SSL Using an Nginx Reverse Proxy on Ubuntu 18.04

    In Section 3 you learned how to secure web servers with Letsencrypt. In this tutorial you will place Jenkins behind an Nginx server, and secure it using a Letsencrypt TLS certificate. This configuration is more secure than running Jenkins on its own because it protects sensitive data like usernames and passwords when you are logging into Jenkins.

    Go to tutorial