Created
May 11, 2019 17:54
-
-
Save namnm/624c5d46e8be893d5c9c638642c5710f to your computer and use it in GitHub Desktop.
Install tools for a fresh Digital Ocean Ubuntu instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Permissions 0644 for '/root/.ssh/id_rsa' are too open. | |
chmod 400 ~/.ssh/id_rsa | |
# Update apt-get | |
sudo apt-get update | |
# Enable firewall | |
sudo apt-get install ufw | |
sudo ufw disable | |
sudo ufw allow 22 | |
sudo ufw allow 80 | |
sudo ufw allow 443 | |
sudo ufw enable | |
# Common cli tools | |
sudo apt-get install tree | |
# Install nvm + node | |
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash | |
nvm install v12.2.0 | |
nvm use v12.2.0 | |
nvm alias default v12.2.0 | |
npm i -g yarn pm2 | |
# Install gvm + go | |
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
sudo apt-get install binutils bison gcc make | |
gvm install go1.12.5 -B | |
gvm use go1.12.5 --default | |
# Postgres 9.5 | |
sudo apt-get install postgresql postgresql-contrib | |
sudo -i -u postgres | |
psql | |
CREATE ROLE root WITH LOGIN; | |
ALTER ROLE root SUPERUSER; | |
\q | |
exit | |
psql postgres # Login with user root | |
# | |
sudo apt-get update | |
sudo apt-get install mysql-server | |
mysql_secure_installation | |
# Install nginx | |
sudo apt-get install nginx | |
sudo service nginx start | |
# Certbot auto | |
wget https://dl.eff.org/certbot-auto | |
chmod a+x ./certbot-auto | |
# Remove a certificate | |
./certbot-auto delete --cert-name example.com | |
# Make swap 4GB | |
# https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04 | |
sudo fallocate -l 4G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile | |
sudo swapon /swapfile | |
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab | |
sudo nano /etc/sysctl.conf | |
vm.swappiness=10 | |
vm.vfs_cache_pressure=50 | |
# FFMPEG | |
# TODO | |
# Coturn | |
# TODO | |
sudo turnserver -a -v -n --no-dtls --no-tls -u 0:0 -r 000 | |
# Show all listening port | |
sudo lsof -i -n -P | more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment