Skip to content

Instantly share code, notes, and snippets.

@sungwoncho
Last active August 5, 2017 04:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sungwoncho/39a9762713f3bde73cce7d6d3b59008f to your computer and use it in GitHub Desktop.
Save sungwoncho/39a9762713f3bde73cce7d6d3b59008f to your computer and use it in GitHub Desktop.
Bootstrap a fresh Ubuntu 16 instance
#!/bin/bash
# bootstrap a fresh instance running Ubuntu 16.04
sudo apt-get update
sudo apt-get install -y zsh
sudo apt-get install -y nginx
sudo apt-get install -y tmux
sudo apt-get install -y postgresql postgresql-contrib
# nginx stuff
sudo rm /etc/nginx/sites-available/default
sudo touch /etc/nginx/sites-available/project.conf
sudo ln -s /etc/nginx/sites-available/project.conf /etc/nginx/sites-enabled/project.conf
# sudo cat <<EOT >> /etc/nginx/sites-available/project.conf
# map $http_upgrade $connection_upgrade {
# default upgrade;
# '' close;
# }
# server {
# listen 443 ssl;
# server_name dnote.io;
# ssl_certificate /etc/letsencrypt/live/dnote.io/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/dnote.io/privkey.pem;
# access_log /var/log/nginx/dnote-access.log;
# error_log /var/log/nginx/dnote-error.log;
# location / {
# proxy_pass http://127.0.0.1:3000;
# proxy_set_header X-Forwarded-For $remote_addr;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection $connection_upgrade;
# }
# }
# server {
# listen 80;
# server_name dnote.io;
# return 301 https://$host$request_uri;
# }
# EOT
# nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
nvm install v6.10.1
# dotfiles
git clone https://github.com/sungwoncho/dotfiles.git .dotfiles
sudo ~/.dotfiles/scripts/bootstrap
# use zsh
zsh
sudo chsh -s $(which zsh) ubuntu
# Install server utilities
npm install -g pm2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment