How to perform a minimal installation of Ubuntu Server 18.04 LTS

本文介绍了如何进行Ubuntu Server 18.04 LTS的最小化安装,包括选择正确的安装ISO,预安装和后安装配置。在后安装配置中,涉及了更改APT镜像源、禁用iSCSI服务和设置防火墙等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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, select Go Back and choose Configure network manually.
Enter the designated IP 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值