Ubuntu 18.
04 Server Configuration Cheat Sheet
by doublehelix via cheatography.com/27391/cs/19030/
Ubuntu Server 18.04 Install Webmin (cont)
sudo apt-key add jcameron-key.asc
4. Update packages including the Webmin repository
sudo apt update
5. Install Webmin
apt - Advanced Packaging Tool sudo apt install webmin
Update available packages sudo apt update Once the installation finishes, you'll be presented with the following
Upgrades all currently installed packages sudo apt upgrade output:
Remove packages that are no longer sudo apt autore‐ Webmin install complete. You can now login to https://your_server_i‐
required move p:10000 as root with your root password, or as any user who can
use sudo.
http://manpages.ubuntu.com/manpages/cosmic/man8/apt.8.html
Add port 10000 to your firewall
ufw - Uncomplicated Firewall sudo ufw allow 10000
1. Install ufw sudo apt install ufw https://www.digitalocean.com/community/tutorials/how-to-install-we‐
2 Setup default policies sudo ufw default deny incoming bmin-on-ubuntu-18-04
or
sudo ufw default allow outgoing
http://www.webmin.com/deb.html
3. Allow SSH sudo ufw allow 22
...or sudo ufw allow ssh Install Apache 2.4
4. Enable ufw sudo ufw enable Install Apache 2.x sudo apt install apache2
5. Allow other connections ... or, as a single sudo apt update && apt-get
...Apache sudo ufw allow 'Apache Full' command install apache2
...Webmin sudo ufw allow 10000 Enable ports through ufw sudo ufw allow http && ufw
firewall allow https
View current ufw status sudo ufw status verbose
... or, via pre-defined app sudo ufw allow 'Apache Full'
https://help.ubuntu.com/community/UFW
settings
or
Start Apache sudo apachectl start
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-f‐
irewall-with-ufw-on-ubuntu-18-04 Restart Apache after sudo apachectl restart
changing settings
Install Webmin Where is Apache installed which apache2
1. Edit the sources list https://help.ubuntu.com/lts/serverguide/httpd.html
sudo nano /etc/apt/sources.list or
Add the following line to your sources file https://www.digitalocean.com/community/tutorials/how-to-install-the-
apache-web-server-on-ubuntu-18-04
deb https://download.webmin.com/download/repos‐
itory sarge contrib
2. Download the Webmin PGP key
wget http://www.webmin.com/jcameron-key.asc
3. Install the Webmin PGP key
By doublehelix Published 13th March, 2019. Sponsored by Readable.com
Last updated 9th April, 2019. Measure your website readability!
Page 1 of 2. https://readable.com
cheatography.com/doublehelix/
Ubuntu 18.04 Server Configuration Cheat Sheet
by doublehelix via cheatography.com/27391/cs/19030/
Install PHP Install MongoDB
1. Install sudo apt install php libapache2-mod-php Install MongoDB package sudo apt install -y mongodb-
PHP org
2. Restart sudo systemctl restart apache2 Check MongoDB service sudo systemctl status mongodb
Apache status
Check where which php Start MongoDB sudo systemctl start
PHP is mongod.service
installed
Stop MongoDB sudo systemctl stop
Check PHP php -v mongod.service
version
Restart the MongoDB sudo systemctl restart
Check INI php --ini
service mongodb
file config‐
Enable automatic service sudo systemctl enable
uration
startup mongod.service
Dump PHP php --info
configuration Disable automatic service sudo systemctl disable
startup mongodb
Install apt-get install php-pear php-fpm php-
optional dev php-zip php-curl php-xmlrpc php-gd https://www.digitalocean.com/community/tutorials/how-to-install-mo‐
modules php-mysql php-mbstring php-xml libapa‐ ngodb-on-ubuntu-18-04
che2-mod-php or
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-‐
check all the apt-cache search --names-only ^php
ubuntu/
PHP
or
modules
https://websiteforstudents.com/install-mongodb-on-ubuntu-18-04-‐
available in
lts-beta-server/
Ubuntu
https://help.ubuntu.com/lts/serverguide/php.html.en-AU
or
https://thishosting.rocks/install-php-on-ubuntu/
Install MySQL
Install MySQL sudo apt install mysql-server
Once the installation is complete, the MySQL server should be
started automatically.
Check the status of sudo netstat -tap | grep
MySQL mysql
Start the service (if not sudo systemctl restart
running) mysql.service
https://help.ubuntu.com/lts/serverguide/mysql.html.en
or
https://www.digitalocean.com/community/tutorials/how-to-install-the-
latest-mysql-on-ubuntu-18-04
By doublehelix Published 13th March, 2019. Sponsored by Readable.com
Last updated 9th April, 2019. Measure your website readability!
Page 2 of 2. https://readable.com
cheatography.com/doublehelix/