Skip to content

Instantly share code, notes, and snippets.

@sourcec0de
Last active November 15, 2018 08:44
Show Gist options
  • Save sourcec0de/5205856 to your computer and use it in GitHub Desktop.
Save sourcec0de/5205856 to your computer and use it in GitHub Desktop.
A Rock solid nodejs platform install script. Latest Redis, MongoDB, and NodeJS V10.9.0 tested Ubuntu 13.04 X64
#!/bin/sh
# Add MongoDB Package
echo "Add MongoDB Package"
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
echo "MongoDB Package completed"
# Update System
echo "System Update"
apt-get -y update
echo "Update completed"
# Install help app
apt-get -y install libssl-dev git-core pkg-config build-essential curl gcc g++ checkinstall
# Download & Unpack Node.js - v. 0.10.9
echo "Download Node.js - v. 0.10.9"
mkdir /tmp/node-install
cd /tmp/node-install
wget http://nodejs.org/dist/v0.10.9/node-v0.10.9.tar.gz
tar -zxf node-v0.10.9.tar.gz
echo "Node.js download & unpack completed"
# Install Node.js
echo Install Node.js
cd node-v0.10.9
./configure && make && checkinstall --install=yes --pkgname=nodejs --pkgversion "0.10.9" --default
echo "Node.js install completed"
# Install MongoDB
echo "Install MongoDB"
apt-get -y install mongodb-10gen
echo "MongoDB install completed."
# Install Redis
echo "Install Redis"
cd /tmp
mkdir redis && cd redis
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
cd src
sudo cp redis-server /usr/local/bin/
sudo cp redis-cli /usr/local/bin/
echo 'Redis install completed."'
@salmangadit
Copy link

Thanks! Should probably add git to this too!

@ComethTheNerd
Copy link

Mac users can replace cd /tmp with cd $TMPDIR, and instead of using wget can use curl, eg. for Redis the command becomes curl http://download.redis.io/redis-stable.tar.gz -o redis-stable.tar.gz

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