How to install and configure an Ubuntu Server 20.04 LTS
WARNING: This documentation will be based on the "legacy" version of 20.04.
NOTE: This documentation was developed using the "legacy" CD image for Ubuntu Server 20.04 which seems just like the 18.04 traditional installer but seems to be hidden from the download menus and being phased out.
Greetings and salutations,
I hope this thread will be helpful to those who follow in my foot steps as well as getting any advice based on what I have done / documented.
Link to original post: HammondsLegacy Forums
High-level overview
This document will cover installation of a dedicated Ubuntu server. This will be the "base" installation of the server as a prerequisite for other documents that will build upon it (e.g. MariaDB, Apache, MediaWiki, etc.). The server will be installed inside a virtual machine using vSphere running on ESXi servers. Notes will also be supplied for doing the same thing for Oracle's VirtualBox on a Windows 10 PC. Although there are some VMware-specific and VirtualBox-specific steps, they are very few and the majority of this documentation will work for other Virtual Machines or even directly installed onto a physical machine (e.g. bare-metal install).
This document will also cover some custom scripts to help automate tasks such as backing up, automatically growing the file system when free space is low, etc.
Tools utilized in this process
Helpful links
The list below are sources of information that helped me configure this system as well as some places that might be helpful to me later on as this process continues.
Assumptions
This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. This variable data will be noted in this section and highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using these "place-holder" values.
Under no circumstance should you use the actual values listed below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.
Wherever you see RED in this document, you need to substitute it for what your company uses.
- Ubuntu Server name: srv-ubuntu
- Internet domain: mydomain.com
- Ubuntu Server IP address: 192.168.107.2
- Ubuntu Server IP subnet mask: 255.255.255.0
- Ubuntu Server IP gateway: 192.168.107.1
- Internal DNS Server 1: 192.168.107.212
- Internal DNS Server 2: 192.168.107.213
- External DNS Server 1: 1.1.1.1 (Cloudflare)
- External DNS Server 2: 8.8.8.8 (Google)
- Ubuntu Admin ID: administrator
- Ubuntu Admin Password: myadminpass
- Email Server (remote): 192.168.107.25
- Windows Share ID: myshare
- Windows Share Password: mysharepass
It is also assumed that the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it. The vim-nox package that is installed later includes "vimtutor" which is also a good place to learn how to use the vi editor.
Re: How to install and configure an Ubuntu Server 20.04 LTS
Analysis and Design
The Ubuntu Server Long-Term Support (LTS) is great choice for companies because it is a solid operating system that happens to be free. If professional support is needed, there is an option to buy support for the Long-Term Support (LTS) versions of the operating system.
The large decision over the configuration of Ubuntu is how the hard drive space is sliced up (partitioned). This documentation will focus on partitioning the drives in such a way that it allows for growth depending on what is needed for the specific application.
This following design allows for dynamic growth and fine-tuning if need be. Being caught offguard with a scenario where space is filled up with no immediate option other than deleting files is never a good thing. Long-term life and growth of the system as well as budgeting concerns have to be taken into consideration.
Isolating the root volume to mainly just static data that will not grow much over time is the central concern. Pushing the other folders into their own volumes will be done so their dynamic growth will not affect the root partition. Filling up the root volume on a *nix system is a very bad thing and should be avoided at all costs. The file systems will also not take up 100% of the logical volume. This will allow the file systems (through automated scripts) to grow as needed and give the administrators some time to add more drives if necessary or shrink other volumes to get more space.
The volumes will initially be sliced up as follows:
- boot - This will remain static in size. It is also the only space residing outside the Logical Volume Manager (LVM)
- root volume - Operating system and everything else which should remain fairly static.
- home volume - This is where personal files will be stored but likely not be used in most server configurations.
- tmp volume - This location will be used for temporary storage. Size should be adjusted to match however it is being used.
- var volume - This is the app/database/log storage and will continue to grow over time.
- bak volume - This will contain a local backup of the server/applications/data. So space needs to be about double the size of your application data (typically double the /var and /opt size).
- Offsite Storage - This will be handled elsewhere but will be mounted on this server.
The partitions will be increased later as needed but will start off with a minimum size.
To get a good idea of the initial hard drive layout and to understand the process better, here is a graphical representation of the initial design for the server:
https://images.hammondslegacy.com/li...ign-Base20.png
These numbers will be used for the initial build of the system:
boot = 1 GB
root = 5 GB
home = 0.2 GB
tmp = 0.5 GB
var = 2.0 GB
bak = 0.5 GB
Important information
- When the logical volumes and file systems are initially created, they consume the maximum amount of space allocated which means the file system size will initially equal the logical volume size. These partition sizes above are artificially small for that reason. These will be later modified so that the logical volume will be larger than the file system so that the file system has room to expand when needed in a safe and automated manner.
- If you want, you can initially allocate a larger disk such as a 50 GB drive rather than adding the 2nd and 3rd disk as noted in these steps. These are just examples on how to manage and expand your storage when needed.
- The /tmp folder is strictly temporary. By default, each time the server reboots, this folder is deleted and re-created.
- The /bak folder will retain the most recent backup and is considered the "local" copy of the backup.
VMware Virtual Machine Settings
- Configuration: Custom
- Name: srv-ubuntu
- Datastore: DS3400-LUN0
- Virtual Machine Version: 8
- Guest Operating System: Linux, Version: Ubuntu Linux (64-bit)
- Number of virtual processors: 1
- Memory Size: 1024 MB
- Number of NICs: 1
- NIC 1: VM Network
- Adapter: E1000, Connect at Power On: Checked
- SCSI controller: LSI Logic Parallel
- Select a Disk: Create a new virtual disk
- Create a Disk: 25 GB, No thin provisioning, No cluster features, Store with the virtual machine
- Advanced Options: Virtual Device Node = SCSI (0:0)
- Remove Floppy Drive
- Mount CD/DVD Drive to Ubuntu ISO (ubuntu-20.04-legacy-server-amd64.iso). Make sure CD/DVD is set to Connect at power on
- Set boot options to Force BIOS Setup so you can set CDROM to boot before the Hard Disk
VirtualBox Virtual Machine Settings
- Name: srv-ubuntu
- Operating System: Linux
- Version: Ubuntu (64 bit)
- Memory: 1024 MB
- Check - Start-up Disk
- Create new hard disk
- VMDK
- Dynamically allocated
- Size: 25 GB - Select srv-ubuntu and click Settings (CTRL+S)
- System, Processor, Enable PAE/NX
- Network, Attached to: Bridged Adapter, Advanced, Adapter Type: Intel PRO/1000 MT Server
- Storage, IDE Controller, Choose a virtual CD/DVD disk file, ubuntu-20.04-legacy-server-amd64.iso
Install PuTTY
When running inside a virtual machine, the response time for screen refreshes can be painfully slow to view man (manual) pages and navigating in VI (text editor). However, when using PuTTY via SSH, it is a far better solution for your Ubuntu console because it handles the screen draws much faster when scrolling and allows copying and pasting text between windows.
For example, selecting and copying a command in this document and then right-clicking in the PuTTY window will paste the command and have it ready to execute. Any text/lines highlighted with the mouse will be automatically copied into clipboard memory.
Download the portable edition and run the install...except it does not really "install" like a normal program, it simply extracts to a specified folder and will run from that folder even if you put it on a USB stick and carry over to a new computer (requires no install to run and thus leaves no footprint on your system)
- Start PuTTY
- Under Window - Translation - Remote character set, select UTF-8
- Type the following and click the Save button:
Host Name: SRV-Ubuntu (or the IP such as 192.168.107.2)
Port: 22
Connection type: SSH
Saved Sessions: SRV-Ubuntu - Now all you have to do is double-click on the session and it will connect to your server (when online).