Skip to content

Instantly share code, notes, and snippets.

@sheikhwaqas
Last active March 7, 2024 05:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save sheikhwaqas/9088780 to your computer and use it in GitHub Desktop.
Save sheikhwaqas/9088780 to your computer and use it in GitHub Desktop.
Install MongoDB Server on Ubuntu
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "America/Chicago" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
ufw allow 27017
ufw allow 27018
ufw allow 27019
ufw allow 28017
# Install essential packages
apt-get -y install git zsh curl htop
# Install MongoDB Server
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
apt-get update
apt-get install mongodb-10gen
@meawoppl
Copy link

meawoppl commented Dec 3, 2014

Thats a bad idea.

@ayorhan
Copy link

ayorhan commented Dec 30, 2015

what's a bad idea? @meawoppl

@ericnakagawa
Copy link

@ayorhan You shouldn't leave a mongo database exposed to public.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment