How to perform a minimal installation of Ubuntu Server 18.04 LTS
Installation ISO
There are subtle but significant differences between a live-server
installation and a traditional server
installation. (See this and this)
After careful considerations, we decided to use the traditional one. Please make sure the name of the installation image contains server
, amd64
but no live
. The latest installation image can be found at Tsinghua Tuna. You should always choose the latest point release. At the time of writing, it is 18.04.2
.
Pre-installation configurations
Follow the installer and use these configurations for each item.
If an item is empty, it means “make something up unless you have instructions from a network administrator”.
- Language:
English
- Country:
other => Asia => China
- Locale:
United States - en_US.UTF-8
- Keyboard:
English (US)
- Network: (this should be automatic when a DHCP server is available)
Manually configure network settings
NOTE: Please keep automatic configurations unless you have instructions from a network administrator.
When prompted for Hostname, selectGo Back
and chooseConfigure network manually
.
Enter the designatedIP address
,netmask
,gateway
,nameserver
when prompted.
- Hostname:
- Domain:
xxxx.edu.cn
- User full name:
- Username:
- Password:
- Time zone:
Asia/Chongqing
(this should be automatic) - Disk partition:
Guided partitioning => Guided - use entire disk
Please let the installer partition the disk instead of doing it manually unless you understand how to partition disks and there are special requirements.
- Proxy server: (leave it blank)
- Configuring tasksel:
No automatic updates
- Software selection: only
OpenSSH server
Installation should begin now.
Post-installation configurations
Change APT mirror
Mirror list:
- mirrors.tuna.tsinghua.edu.cn (Tsinghua Tuna)
- mirrors.aliyun.com (Aliyun)
- ftp.sjtu.edu.cn (Shanghai Jiaotong University)
# Back up the old APT sources list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
# Use an APT mirror
sudo sed -i 's/cn.archive.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
sudo sed -i 's/security.ubuntu.com/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
# Update from the new mirror
sudo apt update
sudo apt upgrade
# Clean up unnecessary dependencies
sudo apt autoremove
Disable iSCSI services
These two services may cause severe boot delay (about 5 minutes) under some circumstances. Better turn them off unless needed.
sudo systemctl disable iscsid.service open-iscsi.service
See this and this for details.
Configure Firewall
# Check UFW status
sudo ufw status verbose
# Deny all incoming connections by default
sudo ufw default deny incoming
# All all outgoing connections by default
sudo ufw default allow outgoing
# Allow SSH connections
sudo ufw allow ssh
# Allow HTTP and HTTPS
# Enable these two only if needed
sudo ufw allow http
sudo ufw allow https
# Check added rules
# Make sure ssh is allowed!!
sudo ufw show added
# Enable UFW
sudo ufw enable
# Check UFW status
sudo ufw status verbose
See this link for additional information about UFW
.