From 4b00c6ef25c36655667586128895dbffc01344b5 Mon Sep 17 00:00:00 2001 From: jtfairbank Date: Wed, 28 Jan 2026 20:15:27 +0100 Subject: [PATCH] docs: add website server management docs --- src/content/docs/add-user.md | 25 +++++++++++++++++++++++++ src/content/docs/deploy-website.md | 26 ++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 src/content/docs/add-user.md create mode 100644 src/content/docs/deploy-website.md diff --git a/src/content/docs/add-user.md b/src/content/docs/add-user.md new file mode 100644 index 0000000..3e53efb --- /dev/null +++ b/src/content/docs/add-user.md @@ -0,0 +1,25 @@ +``` +# ssh into the server +ssh [server ip] + +# add new admin +sudo adduser [username] +sudo usermod -aG sudo [username] + +# confirm it works +id [username] + +# add to AllowUsers setting for ssh access +sudo vim /etc/ssh/sshd_config +sudo systemctl reload ssh + +# add their public ssh key +sudo su - [username] +mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys +vim ./.ssh/authorized_keys +exit + +# optionally log out of the server +exit +``` + diff --git a/src/content/docs/deploy-website.md b/src/content/docs/deploy-website.md new file mode 100644 index 0000000..2903f24 --- /dev/null +++ b/src/content/docs/deploy-website.md @@ -0,0 +1,26 @@ +``` +# ssh into the server +ssh [ip address] + +# change to the deploy user +sudo su - deploy + +# update the relevant branch +cd ./next-website-v2/ +git branch +git checkout main # or the branch you want +git pull +yarn install + +# build and deploy the site +yarn build +pm2 list +pm2 restart 0 # or id of instance you want to restart + +# visit the site to make sure it works + +# log out of the deploy user, and optionally the server +exit +exit +`` +