Last active
November 17, 2022 11:57
-
-
Save aedm/a466e8bb99309a4f378394187923fb88 to your computer and use it in GitHub Desktop.
Installs Docker & Nginx on Ubuntu 16.04, starts MongoDB container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# curl {URL to this script} | sh -s | |
# install docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update | |
apt-cache policy docker-ce | |
sudo apt-get install -y docker-ce | |
sudo systemctl status docker | |
# add current user to Docker runners | |
sudo usermod -aG docker ${USER} | |
# install nginx | |
sudo apt-get install -y nginx | |
sudo ufw app list | |
sudo ufw allow 'Nginx HTTP' | |
sudo service nginx start | |
sudo systemctl restart nginx | |
# start MongoDB as a Docker service | |
sudo docker run --name mongo -d --restart always mongo | |
# install MongoDB client tools (mongodump etc) | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 | |
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list | |
sudo apt-get update | |
sudo apt-get install -y mongodb-org-tools mongodb-org-shell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment