Skip to content

Instantly share code, notes, and snippets.

@kallebysantos
Last active July 26, 2024 08:42
Show Gist options
  • Save kallebysantos/45245342fff3ffc4e240daf802b71de0 to your computer and use it in GitHub Desktop.
Save kallebysantos/45245342fff3ffc4e240daf802b71de0 to your computer and use it in GitHub Desktop.
Guide for setup a Linux server in order to run containerized applications
# Server Setup
## **Setup [Docker Engine:](https://www.docker.com/)**
#### Uninstall old versions:
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get remove docker docker-engine docker.io containerd runc
#### Set up the docker apt repository:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
#### Install Docker Engine:
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#### Add permissions to Manage Docker as a non-root user:
sudo groupadd docker
sudo usermod -aG docker $USER
exit

Server Setup

Installing environment tools:

Uninstall old versions:

sudo apt-get remove docker docker-engine docker.io containerd runc

Set up the docker apt repository:

sudo apt-get update
sudo apt-get install \
   ca-certificates \
   curl \
   gnupg \
   lsb-release

Add Docker’s official GPG key:

sudo mkdir -m 0755 -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Install Docker Engine:

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Add permissions to Manage Docker as a non-root user:

sudo groupadd docker
sudo usermod -aG docker $USER

Log out and log back in so that your group membership is re-evaluated.

docker run hello-world

Setup Arkade:

curl -sLS https://get.arkade.dev | sudo sh
arkade --help
ark --help  # a handy alias

Setup Kubernetes:

Installation:

Adding Minikube:

arkade get minikube
sudo mv /home/ubuntu/.arkade/bin/minikube /usr/local/bin/

Adding Kubectl:

arkade get kubectl
sudo mv /home/ubuntu/.arkade/bin/kubectl /usr/local/bin/
kubectl --help

Adding Helm:

arkade get helm
sudo mv /home/ubuntu/.arkade/bin/helm /usr/local/bin/
helm --help

Accessing minikube dashboard:

Run minikube dashboard as background job:

minikube dashboard &

Start kubectl proxy:

minikube kubectl proxy

Access dashboard remotely:

ssh -L 80:localhost:8001 myLogin@myRemoteServer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment