Skip to content

Instantly share code, notes, and snippets.

@johnrees
Last active November 29, 2021 01:42
Show Gist options
  • Select an option

  • Save johnrees/1985879 to your computer and use it in GitHub Desktop.

Select an option

Save johnrees/1985879 to your computer and use it in GitHub Desktop.
Standard Rails 5.* setup for Ubuntu 14.04 LTS
# As root user
sudo su
# Update the OS
apt-get update -y
apt-get upgrade -y
# Setup TimeZone
dpkg-reconfigure tzdata
# Install Rails Requirements w/ NGINX & NODE repo
apt-get install build-essential zlib1g-dev curl git-core libgeoip-dev python-software-properties libssl-dev openssl libreadline-dev -y
# Add Nginx and Node
add-apt-repository ppa:nginx/stable
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nginx nodejs -y
sudo service nginx restart
# Install Firewall
apt-get install ufw -y
ufw enable
ufw allow 22
ufw allow 80
# Add Deployment User
groupadd admin
adduser deployer --ingroup admin
su deployer
# logout
# ssh-copy-id keys to server
# login as deployer
# Say hello to git
ssh git@github.com
# Install rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.profile
echo 'eval "$(rbenv init -)"' >> ~/.profile
exec $SHELL -l
# Install Ruby build
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv rehash
rbenv install 2.0.0-p247
rbenv global 2.0.0-p247
# Check installation went OK
ruby -v
# Install Bundler
vim ~/.gemrc
gem: --no-ri --no-rdoc
gem install bundler
rbenv rehash
# ...
# Install postgres etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment