Show Menu

Ubuntu 18.04 Server Configuration Cheat Sheet by

Common commands and installation basics I need to remember
linux     ubuntu     -nix

Ubuntu Server 18.04

apt - Advanced Packaging Tool

Update available packages
sudo apt update
Upgrades all currently installed packages
sudo apt upgrade
Remove packages that are no longer required
sudo apt autore­move

ufw - Uncomp­licated Firewall

1. Install ufw
sudo apt install ufw
2 Setup default policies
sudo ufw default deny incoming
 
sudo ufw default allow outgoing
3. Allow SSH
sudo ufw allow 22
...or
sudo ufw allow ssh
4. Enable ufw
sudo ufw enable
5. Allow other connec­tions
...Apache
sudo ufw allow 'Apache Full'
...Webmin
sudo ufw allow 10000
View current ufw status
sudo ufw status verbose

Install Webmin

1. Edit the sour­ces list
sudo nano /etc/a­pt/­sou­rce­s.list
Add the following line to your sources file
2. Download the Webmin PGP key
3. Install the Webmin PGP key
sudo apt-key add jcamer­on-­key.asc
4. Update packages including the Webmin repository
sudo apt update
5. Install Webmin
sudo apt install webmin
Once the instal­lation finishes, you'll be presented with the following output:
Webmin install complete. You can now login to https:­//y­our­_se­rve­r_i­p:10000 as root with your root password, or as any user who can use sudo.
Add port 10000 to your firewall
sudo ufw allow 10000
 

Install Apache 2.4

Install Apache 2.x
sudo apt install apache2
... or, as a single command
sudo apt update && apt-get install apache2
Enable ports through ufw firewall
sudo ufw allow http && ufw allow https
... or, via pre-de­fined app settings
sudo ufw allow 'Apache Full'
Start Apache
sudo apachectl start
Restart Apache after changing settings
sudo apachectl restart
Where is Apache installed
which apache2

Install PHP

1. Install PHP
sudo apt install php libapa­che­2-m­od-php
2. Restart Apache
sudo systemctl restart apache2
Check where PHP is installed
which php
Check PHP version
php -v
Check INI file config­uration
php --ini
Dump PHP config­uration
php --info
Install optional modules
apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mb­string php-xml libapa­che­2-m­od-php
check all the PHP modules available in Ubuntu
apt-cache search --name­s-only ^php

Install MySQL

Install MySQL
sudo apt install mysql-­server
Once the instal­lation is complete, the MySQL server should be started automa­tic­ally.
Check the status of MySQL
sudo netstat -tap | grep mysql
Start the service (if not running)
sudo systemctl restart mysql.s­er­vice

Install MongoDB

Install MongoDB package
sudo apt install -y mongod­b-org
Check MongoDB service status
sudo systemctl status mongodb
Start MongoDB
sudo systemctl start mongod.se­rvice
Stop MongoDB
sudo systemctl stop mongod.se­rvice
Restart the MongoDB service
sudo systemctl restart mongodb
Enable automatic service startup
sudo systemctl enable mongod.se­rvice
Disable automatic service startup
sudo systemctl disable mongodb

Download the Ubuntu 18.04 Server Configuration Cheat Sheet

2 Pages
//media.cheatography.com/storage/thumb/doublehelix_ubuntu-18-04-server-configuration.750.jpg

PDF (recommended)

Alternative Downloads

Share This Cheat Sheet!

 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          Ubuntu Compose Key Combinations Cheat Sheet
          Ubuntu Unity 16.04 Keyboard Shortcuts

          More Cheat Sheets by doublehelix