Skip to main content

Application server preparation steps

Application server preparation steps

Prerequisites

  • Linux server is up and running and all system requirements are met as described in System requirements
  • SSH access is allowed to the servers with root privileges

  • Ports are opened
  • Installation package is uploaded to server

Docker service 

Dothe is require for the platform. Refer the official Install Docker Engine in case of any issues with docker installation. 

"overlay2" is recommended storage driver for the docker daemon. Note that XFS require to have d_type=1 for using overlay2 driver.

Configure docker client default timeouts

For low performance hardware systems it is strongly recommended to increase docker client timeout settings.

$ export DOCKER_CLIENT_TIMEOUT=1500
$ export COMPOSE_HTTP_TIMEOUT=1500

You should also add it into the file .profile (permanently setting for these variables).

Configure user groups

Make sure current user is in docker group. This is required to import images and start containers.

$ sudo usermod -a -G docker ${username}

Make sure current user is in sudoers file (or group). This is required to set proper permissions on work folders.

$ sudo adduser ${username} sudo

Firewall

You system could have firewall running, it this case you need to open ports from the Ports section.


For example on Centos 8 it has it running by default, here are script that adds exclusion for default docker networks:

# open all IPs starts with "172" so that all the containers may communicate each other
$ sudo firewall-cmd --permanent --zone=public --add-rich-rule='rule family=ipv4 source address=172.0.0.0/8 accept'

# make our container able to visit the network outside 
$ sudo firewall-cmd --permanent --zone=public --add-masquerade

# make our container able to visit the network outside 
$ sudo firewall-cmd --permanent --zone=public --add-masquerade

$ sudo systemctl restart docker

For Ubuntu 18+ you need to use ufw command, to check and configure, f.e. shows the active rules:

$ sudo ufw status

Ubuntu (20.04,)

Set up the repository.

1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install -y --no-install-recommends curl gnupg2 software-properties-common

2. Add Docker’s official GPG key:

$ sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

$ sudo apt-key fingerprint 0EBFCD88

pub	 4096R/0EBFCD88 2017-02-22
		9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid	 Docker Release (CE deb) <docker@docker.com>
sub	 rsa4096 2017-02-22 [S]

3. Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below.

Note: The lsb_release -cs sub-command below returns the name of your Debian distribution, such as helium. Sometimes, in a distribution like BunsenLabs Linux, you might need to change $(lsb_release -cs) to your parent Debian distribution. For example, if you are using BunsenLabs Linux Helium, you could use stretch. Docker does not offer any guarantees on untested and unsupported Debian distributions.

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker Engine

Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

$ sudo apt-get update
$ sudo apt-get install -y docker-compose docker-ce docker-ce-cli containerd.io

Install OpenJDK 17Dockerbzip2 and apache2-utils

$ sudo apt-get install -y --no-install-recommends apache2-utils bzip2 openjdk-17-jre-headless

Debian (10,)

Set up the repository.

1. Update the apt package index and install packages to allow apt to use a repository over HTTPS:

$ sudo apt-get update
$ sudo apt-get install -y apt-utils apt-transport-https ca-certificates curl sudo gnupg-agent software-properties-common

2. Add Docker’s official GPG key:

$ curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint.

$ sudo apt-key fingerprint 0EBFCD88

pub	 4096R/0EBFCD88 2017-02-22
		Key fingerprint = 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid	 Docker Release (CE deb) <docker@docker.com>
sub	 4096R/F273FCD8 2017-02-22

3. Use the following command to set up the stable repository. To add the nightly or test repository, add the word nightly or test (or both) after the word stable in the commands below.

Note: The lsb_release -cs sub-command below returns the name of your Debian distribution, such as helium. Sometimes, in a distribution like BunsenLabs Linux, you might need to change $(lsb_release -cs) to your parent Debian distribution. For example, if you are using BunsenLabs Linux Helium, you could use stretch. Docker does not offer any guarantees on untested and unsupported Debian distributions.

$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

Install Docker Engine

Update the apt package index, and install the latest version of Docker Engine and containerd, or go to the next step to install a specific version:

$ sudo apt-get update
$ sudo apt-get install -y docker-compose docker-ce docker-ce-cli containerd.io

Install OpenJDK 17 and using third parties

$ sudo apt-get install -y apache2-utils bzip2 openjdk-17-jre-headless

Rhel (7)

Set up the repository.

Add subscription on necessary repositories, update the systemd package.

$ sudo subscription-manager repos --enable=rhel-7-server-rpms
$ sudo subscription-manager repos --enable=rhel-7-server-extras-rpms
$ sudo subscription-manager repos --enable=rhel-7-server-optional-rpms
$ sudo yum -y update systemd

Install Docker Engine

Go to "https://download.docker.com/linux/centos/7/index.html" and choose your architecture ("https://download.docker.com/linux/rhel/7/s390x/" for s390x). 
Then browse to /stable/Packages/ and download the .rpm files for the Docker version you want to install. 
You should download next files: containerd.io-{version}.rpm, docker-ce-{version}.rpm, docker-ce-cli-{version}.rpm and docker-ce-rootless-extras-{version}.rpm 
Change the path below to the path where you downloaded the Docker package.
 
$ sudo yum install /path/to/package/*.rpm

Install Docker Compose

Check the latest version in the github download page: https://github.com/docker/compose/tags, download and put it into your bin directory. For example:

$ sudo curl -L "https://github.com/docker/compose/releases/download/2.23.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply executable permissions to the binary

$ sudo chmod +x /usr/local/bin/docker-compose

Start the Docker daemon

$ sudo systemctl start docker

Install OpenJDK 17 and using third parties

$ sudo yum install -y iptables bzip2 sudo httpd-tools openssl java-17-openjdk e4fsprogs

Centos 8, RedHat 8

Set up the repository.

Install the yum-utils package (which provides the yum-config-manager utility).

$ sudo yum update -y
$ sudo yum install -y yum-utils
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

For Centos set up the stable repository.

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

For RedHat set up the stable repository.

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo

Install Docker Engine

$ sudo yum install -y --nobest docker-ce docker-ce-cli containerd.io

Install Docker Compose 

Check the latest version in the github download page: https://github.com/docker/compose/tags, download and put it into your bin directory. For example:

$ sudo curl -L "https://github.com/docker/compose/releases/download/2.23.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply executable permissions to the binary

$ sudo chmod +x /usr/local/bin/docker-compose

Start the Docker daemon

$ sudo systemctl start docker

Install OpenJDK 17 and using third parties

$ sudo yum install -y bzip2 sudo httpd-tools openssl java-17-openjdk e4fsprogs