flatnotes is a simple note app which can be self hosted.
It requires very few resource to launch. My VPS is a debian system, has only 1 core and 512MB ram, but it can run flatnotes smoothly.
First I have to install docker in VPS.
sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
And, make a data dir in my home path.
mkdir ~/data
Then, execute this bash script to run flatnotes from docker.
#!/usr/bin/bash
docker run -d \
-e "PUID=1000" \
-e "PGID=1000" \
-e "FLATNOTES_AUTH_TYPE=password" \
-e "FLATNOTES_USERNAME=your_user" \
-e 'FLATNOTES_PASSWORD=your_pass' \
-e "FLATNOTES_SECRET_KEY=a_random_token" \
-v "$(pwd)/data:/data" \
-p "8080:8080" \
dullage/flatnotes:latest
Please replace USERNAME, PASSWORD, SECRET_KEY with your own strings.
After running, flatnotes opens a HTTP port 8080 on VPS. I would like to setup a reverse proxy for this port.
I have apache2 run on this VPS, so I have to add a configure file for apache2. It looks like:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName note.host.net
ErrorLog ${APACHE_LOG_DIR}/note.host.net_error.log
CustomLog ${APACHE_LOG_DIR}/note.host.net_access.log combined
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
<Directory />
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
The next let's restart apache2:
sudo systemctl restart apache2
Now when I access http://note.host.net I will reach flatnotes' login page.
Input username and password we setup before, should get logged in successfully.