adduser <username>
usermod -aG sudo <username> # enable sudo
EDITOR=vim visudo
# add below line
# <username> ALL=(ALL) NOPASSWD: ALL
- Download caddy-server (for https)
- ssh-keygen for code download
- Install pyenv & pyenv-virtualenv
# pyenv
sudo apt install curl git-core gcc make zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libssl-dev -y
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# try ~/.bashrc if ~/.bash_profile doesn't work
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
# pyenv-virtualenv
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
- Setup virtualenv using pyenv
pyenv install 3.6.13
pyenv virtualenv 3.6.13 my-venv
# from manage.py directory
gunicorn project.wsgi
# this will attempt auto-https using Lets Encrypt
./caddy reverse-proxy --from=sub.domain.com --to=127.0.0.1:8000