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
# Update the OS
apt-get update
apt-get upgrade
apt-get dist-upgrade
# Setup Hostname & TimeZone
echo "{{HOSTNAME}}" > /etc/hostname
hostname -F /etc/hostname
dpkg-reconfigure tzdata
# Install Rails Requirements
sudo apt-get install build-essential zlib1g-dev curl git-core libgeoip-dev
# Install NGINX
apt-get install python-software-properties
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx
sudo service nginx restart
# Install NodeJS
add-apt-repository ppa:chris-lea/node.js
apt-get update
apt-get install nodejs
# Install Firewall
apt-get install ufw
ufw enable
ufw allow 22
ufw allow 80
# Add Deployment User
adduser deployer --ingroup admin
su deployer
# ssh-copy-id keys to server
# Setup GIT
ssh git@github.com
# Install Ruby (RBENV) as per http://bit.ly/yr6Sw6
curl -L https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash
vi ~/.bash_profile
if [[ -d $HOME/.rbenv ]]; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
fi
alias b='bundle exec'
source ~/.bash_profile
rbenv bootstrap-ubuntu-10-04
rbenv install 1.9.3-p0
rbenv global 1.9.3-p0
# Check installation went OK
ruby -v
# Install Bundler
vim ~/.gemrc
gem: --no-ri --no-rdoc
gem install bundler
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment