Skip to content

Instantly share code, notes, and snippets.

@vgk77
Last active February 1, 2024 14:34
Show Gist options
  • Select an option

  • Save vgk77/b249a4721246ca518382f8e27e78ecfa to your computer and use it in GitHub Desktop.

Select an option

Save vgk77/b249a4721246ca518382f8e27e78ecfa to your computer and use it in GitHub Desktop.
Setup #ubuntu server with #docker compose
# To start:
# curl https://gist.githubusercontent.com/vgk77/b249a4721246ca518382f8e27e78ecfa/raw/12eab95e674c0c0517c8562c7e546ed9f8fbc049/hz_setup.sh | sudo bash
#update packages
apt update && apt upgrade -y
apt install mc git vim htop iftop qemu-guest-agent apt-transport-https ca-certificates curl software-properties-common make -y
#change hostname
#sudo hostnamectl set-hostname YOU_HOST_NAME
#setup firewall
ufw allow ssh
echo "y" | sudo ufw enable
#disable password auth
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
systemctl restart ssh
#install docker-ce
#curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
#add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
#apt update && apt install docker-ce -y
#Install docker using the convenience script
$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
#use docker command without sudo
usermod -aG docker ${USER}
#install docker-compose
#curl -L https://github.com/docker/compose/releases/download/1.26.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
#chmod +x /usr/local/bin/docker-compose
sudo apt-get install docker-compose-plugin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment