4Bf18907-Ubuntu-Server-Guide.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Welcome to the Ubuntu Server Guide! Changes, Errors, and Bugs This is the current edition for Ubuntu 20.04 LTS, Focal Fossa. Ubuntu serverguides for previous LTS versions: 18.04 (PDF), 16.04 (PDF). If you find any errors or have suggestions for improvements to pages, please use the link at thebottomof each topic titled: “Help improve this document in the forum.” This link will take you to the Server Discourse forum for the specific page you are viewing. There you can share your comments or let us know aboutbugs with each page. Offline Download this guide as a PDF Support There are a couple of different ways that Ubuntu Server Edition is supported: commercial support and community support. The main commercial support (and development funding) is available from Canonical, Ltd. They supply reasonably- priced support contracts on a per desktop or per server basis. For more information see the Ubuntu Advantage page. Community support is also provided by dedicated individuals and companies that wish to make Ubuntu the best distribution possible. Support is provided through multiple mailing lists, IRC channels, forums, blogs, wikis, etc. The large amount of information available can be overwhelming, but a good search engine query can usually provide an answer to your questions. See the Ubuntu Support page for more information. Installation This chapter provides a quick overview of installing Ubuntu 20.04 Server Edition. For more detailed instruc- tions, please refer to the Ubuntu Installation Guide. Preparing to Install This section explains various aspects to consider before starting the installation. System Requirements Ubuntu 20.04 Server Edition provides a common, minimalist base for a variety of server applications, such as file/print services, web hosting, email hosting, etc. This edition supports five (5) major architectures: AMD64, ARM, POWER9, LinuxONE and z Systems, and introduces initial support for RISC-V. The “live server” installer (sometimes called “Ubiquity for Servers” or simply “Subiquity”) provides a user- friendly and fast installation experience. The table below lists the recommended minimum hardware specifications. Depending on your needs, you might manage with less than this, but it is not generally recommended. 1 Install Type CPU RAM Hard Drive Space Server (Standard) 1 gigahertz 512 megabytes 1.5 gigabyte 2.5 gigabytes live server 1 gigahertz (amd64 only) 1 gigabyte 1.5 gigabyte n/a Server (Minimal) 300 megahertz 384 megabytes 1.5 gigabytes 2.5 gigabytes Server and Desktop Differences The Ubuntu Server Edition and the Ubuntu Desktop Edition use the same apt repositories, making it just as easy to install a server application on the Desktop Edition as on the Server Edition. One major difference is that the graphical environment used for the Desktop Edition is not installed for the Server. This includes the graphics server itself, the graphical utilities and applications, and the various user-supporting services needed by desktop users. The Server Edition’s kernel used to be tuned differently from Desktop, but currently, both rely on the same Linux configuration. Backing Up • Before installing Ubuntu Server Edition you should make sure all data on the system is backed up. If this is not the first time an operating system has been installed on your computer, it is likelyyou will need to re-partition your disk to make room for Ubuntu. Any time you partition your disk, you should be prepared to lose everything on the disk should you make a mistake or something goes wrong during partitioning. The programs used in installation are quite reliable, most have seen years of use, but they also perform destructive actions. Installing using the live server installer The basic steps to install Ubuntu Server Edition are the same as those for installing any operating system. Unlike the Desktop Edition, the Server Edition does not include a graphical installation program. The Live Server installer uses a text-based console interface which runs on the default virtual console. The interface can be entirely driven by the enter, up and down arrow keys (with some occasional typing). During the installation, you can switch to a different console (by pressing Ctrl-Alt-F<n> or Ctrl-Alt-Right) to get access to a shell, if needed. Up to the point where the installation begins, you can use the “back” button to go back to previous screens and choose different options. • Download the appropriate ISO file from the Ubuntu Server Download Page. • Boot the system from media (e.g. USB key) containing the ISO file. • At the boot prompt you will be asked to select a language. • From the main boot menu there are some additional options to install Ubuntu Server Edition. You can install a basic Ubuntu Server, check the installation media for defects, check the system’s RAM, or boot from first hard disk. The rest of this section will cover the basic Ubuntu Server install. • After booting into the installer, it will ask you which language to use. • Next, the installation process begins by asking for your keyboard layout. You can ask the installer to attempt auto-detecting it, or you can select it manually from a list. Later stages of the installation will require you to type ASCII characters, so if the layout you select does not allow that, you will be 2 prompted for a key combination to switch between a layout that does and the one you select. The default keystroke for this is Alt + Shift. • Next, the installer offers the choice to install the system as a vanilla Ubuntu server,a MAAS bare-metal cloud rack controller or a MAAS region controller. If you select one of the MAAS options you will be asked for some details. • The installer configures the network to run DHCP on each network interface. If this is not sufficient to get access to the internet you should configure at least one interface manually. Select an interface to configure it. • If the Ubuntu archive can only be accessed via a proxy in your environment, it can be entered on the next screen. Leave the field blank if it is not required. • You can then choose to let the installer use an entire disk or configure the partitioning manually. The first disk you create a partition on will be selected as the boot disk and have an extra partition created on it to contain the bootloader; you can move the boot partition to a different drive with the “Select as boot disk” button. Once you move on from this screen, the installation progress will begin. It will not be possible to move back to this or previous screens and any data on the disks you have configured the installer to use will be lost. • The next screen configures the initial user for the system. You can import SSH keys from Launchpad or Github but a password is still required to be set, as this user will have root access through the sudo utility. • The final screen shows the progress of the installer. Once the installation has completed, youwillbe prompted to reboot into your newly installed system. Advanced Installation Software RAID Redundant Array of Independent Disks “RAID” is a method of using multiple disks to provide different balances of increasing data reliability and/or increasing input/output performance, depending on the RAID level being used. RAID is implemented in either software (where the operating system knows about both drives and actively maintains both of them) or hardware (where a special controller makes the OS think there’s only one drive and maintains the drives ‘invisibly’). The RAID software included with current versions of Linux (and Ubuntu) is based on the ‘mdadm’ driver and works very well, better even than many so-called ‘hardware’ RAID controllers. This section will guide you through installing Ubuntu Server Edition using two RAID1 partitions on two physical hard drives, one for / and another for swap. RAID Configuration Follow the installation steps until you get to the Guided storage configuration step, then: Select Custom storage layout. Create the /boot partition in a local disk. So select one of the devices listed in available devices and Add GPT Partition. Next, enter the partition size, then choose the desired Format (ext4) and /boot as mount point. And finally, select Create. Now to create the RAID device select Create software RAID (md) under AVAILABLE DEVICES. 3 Add the name of the RAID disk (the default is md0). For this example, select “1 (mirrored)” in RAID level, but if you are using a different setup choose the appropriate type (RAID0 RAID1 RAID5 RAID6 RAID10). Note In order to use RAID5, RAID6 and RAID10 you need more than two drives. Using RAID0 or RAID1 only two drives are required. Select the devices that will be used by this RAID device. The real devices can be marked as active or spare, by default it becomes active when is selected. Select the Size of the RAID device. Select Create. The new RAID device (md0 if you did not change the default) will show up in the available devices list, with software RAID 1 type and the chosen size. Repeat steps above for the other RAID devices. Partitioning Select the RAID 1 device created (md0) then select “Add GPT Partition”. Next, select the Size of the partition. This partition will be the swap partition, and a general rule for swap size is twice that of RAM. Enter the partition size, then choose swap in Format. And finally, select Create. Note A swap partition size of twice the available RAM capacity may not always be desirable, especially on systems with large amounts of RAM. Calculating the swap partition size for servers is highly dependent on how the system is going to be used.