y0ngb1n

Aben Blog

欢迎来到我的技术小黑屋ヾ(◍°∇°◍)ノ゙
github

Upgrade idle computers to personal servers Ubuntu 18.04.2 LTS (Bionic Beaver)

title: 'Upgrading Idle Computers to Personal Servers Ubuntu 18.04.2 LTS (Bionic Beaver)'
cover: 'https://i.loli.net/2019/04/21/5cbbd8240bfe9.jpg'
subtitle: 'Instead of gathering dust! It's better to use it to build a learning and entertainment environment, and have some fun.'
tags:

  • ubuntu
  • linux
    author:
    nick: Yang Bin
    link: https://github.com/y0ngb1n
    abbrlink: 'how-to-install-ubuntu-server-18-04-lts'
    date: 2019-04-21 09:32:00

Preface#

Since Brother Hong's university left behind a dusty desktop computer, it's better to use it for some tinkering and make it shine. So, with Brother Hong's permission, I decided to replace the system with Ubuntu 18.04.2 LTS (Bionic Beaver) Server version, to build a home environment that combines learning and entertainment, mainly for development and learning (tinkering) server use 👊.

It will be used to build my Home Lab and run some services including but not limited to:

ServiceDescription
nginx-proxyDocker-based automated gateway
Pi-holeFilter home ads
GitLabPrivate code repository
JenkinsContinuous integration engine
BitwardenPrivate password manager
......

More services will be maintained in the future at "y0ngb1n/dockerized", welcome to Star 🌟.

Get Ubuntu System#

You can obtain the Ubuntu 18.04.2 LTS (Bionic Beaver) system image from any of the following sources:

SourceSite
Ubuntu Official Websitehttp://releases.ubuntu.com/18.04/
Alibaba Open Source Mirror Sitehttps://mirrors.aliyun.com/ubuntu-releases/18.04/
Tsinghua University Open Source Software Mirror Sitehttps://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/18.04/

The file I want to download is named ubuntu-18.04.2-live-server-amd64.iso, the download link is https://mirrors.aliyun.com/ubuntu-releases/18.04/ubuntu-18.04.2-live-server-amd64.iso, using the Alibaba Open Source Mirror Site, and the file size is 834.00 MB.

Install Ubuntu System#

Before installing the system, prepare a USB flash drive with a capacity of more than 4G and a handy image burning tool (I choose Etcher).

Step 1: Get Etcher#

Flash OS images to SD cards & USB drives, safely and easily.

Etcher is an open source fast burning software that can quickly create USB image tools. It is simple with only one high-value interface. It can help you quickly burn system image files (such as .iso, .img, .dmg, .zip, etc.) into USB devices (flash drives) or SD cards. You can download the latest version of Etcher here.

Etcher App

The interface is simple and the operation is simple, divided into three steps:

  1. Select the image file
  2. Select the disk
  3. Start burning

Step 2: Create a System Boot Disk#

Connect the USB flash drive to the computer, then open Etcher, select the system image and the USB flash drive that you just downloaded, and then click the Flash! button. Let Etcher do the rest.

Step 3: Install Ubuntu System#

First, turn off the host computer to be installed with the system, and connect the USB flash drive, keyboard, and monitor. After powering on, press Escape, F2, F10, F12 or pay attention to the prompts on the screen (this is different for different machines, you can Google it yourself). My motherboard is Asus, and it prompts me to press the F2 or DEL key to enter the BIOS system. The main thing is to set our USB flash drive as the first boot disk and load the USB flash drive first, so that we can install the system.

After successfully booting from the USB flash drive, you can refer to the installation guide provided by Ubuntu, "Install Ubuntu Server" for installation operations. You can use the Alibaba Cloud's public mirror service when setting up the mirror. Enter http://mirrors.aliyun.com/ubuntu/, which can speed up your installation process, otherwise it will default to the official source.

Finally, just wait for the installation to complete! 👏 Yes, just wait.

Step 4: Log in to the System#

$ ssh [email protected]
yangbin@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.2 LTS
Release:        18.04
Codename:       bionic

That's it! 🐶


Configure the Basic Environment of the System#

After installing the system, do some simple configurations.

Configure Software Sources#

It is recommended to use Alibaba Cloud's source. First, create your own configuration file, for example:

/etc/apt/sources.list.d/aliyun.list

Edit the content as follows:

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

Then execute:

sudo apt-get update

That's it.

Configure Time Zone#

Don't forget to configure the system time zone, especially now that it is popular to mount the system time zone in containers.

$ dpkg-reconfigure tzdata  # Use command line interactive interface to modify

Current default time zone: 'Asia/Shanghai'
Local time is now:      Fri May  3 20:59:14 CST 2019.
Universal Time is now:  Fri May  3 12:59:14 UTC 2019.

Install Container Environment#

One-click installation of Docker

Install Docker using Alibaba Cloud's acceleration:

curl -fsSL get.docker.com -o get-docker.sh && \
sudo sh get-docker.sh --mirror Aliyun

Start Docker CE

sudo systemctl enable docker && \
sudo systemctl start docker

One-click installation of Compose

Since Compose is a Python application, it can naturally be executed directly in a container:

export DOCKER_COMPOSE_VERSION=1.24.0
curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/run.sh > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

Configure container image source

mkdir -p /etc/docker && touch /etc/docker/daemon.json

cat <<EOF > /etc/docker/daemon.json
{
    "registry-mirrors": [
        "https://registry.docker-cn.com"
    ]
}
EOF

sudo systemctl start docker

For more configurations, refer to "Ubuntu 18.04 Basic System Configuration" to unlock more possibilities.


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.