Skip to content

Instantly share code, notes, and snippets.

@acook
Last active December 20, 2015 20:48
Show Gist options
  • Save acook/6192391 to your computer and use it in GitHub Desktop.
Save acook/6192391 to your computer and use it in GitHub Desktop.
Ubuntu server setup for Ruby, Nginx, and Node.js.
#!/usr/bin/env/bash
# run this like: `curl https://gist.github.com/acook/6192391/raw/ubuntu_server_setup.bash | bash`
echo "Enter the email address for this server's SSH key: "
read email
mkdir ~/.ssh
ssh-keygen -t rsa -C $email
echo "Enter password to install packages: "
# Install Ruby prerequisites
sudo apt-get update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libcurl4-openssl-dev curl git-core libxslt1-dev libxml2-dev libsqlite3-dev gawk libgdbm-dev libncurses5-dev libffi-dev
# Install RVM + Ruby
echo progress-bar >> ~/.curlrc
\curl -L https://get.rvm.io | bash -s stable --ruby
source ~/.bashrc
# Install base gems
gem install bundler
gem install rubygems-bundler
gem regenerate_binstubs
# Install web server
sudo apt-get install nginx
# Enable web server
sudo service nginx start
sudo update-rc.d nginx defaults
# Install Node.js prerequisites
sudo apt-get install software-properties-common python-software-properties python g++ make
# Add Node.js's apt repo and udpate it
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
# Install Node.js
sudo apt-get install nodejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment