-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Noob-Friendly Setup Tutorial #20
Comments
Nginx is missing HTTPS configuration. |
I use nginx proxy manager, so I might have overlooked this step. I recycled and old guide I tried to use a couple years ago. So please, correct any error. Step 1: Install Certbotsudo apt-get update
sudo apt-get install certbot python3-certbot-nginx Step 2: Obtain SSL Certificatessudo certbot --nginx -d auth.domain.com -d notes.domain.com -d events.domain.com -d mono.domain.com Step 3: Modify Nginx ConfigurationAdd SSL directives to your Nginx configuration. Here is an example of the updated configuration: # Auth Server - Basic (no cache/websocket needed)
server {
listen 80;
server_name auth.domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name auth.domain.com;
ssl_certificate /etc/letsencrypt/live/auth.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/auth.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://localhost:8264;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
# Notes Server - With WebSocket
server {
listen 80;
server_name notes.domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name notes.domain.com;
ssl_certificate /etc/letsencrypt/live/notes.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/notes.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://localhost:5264;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
}
}
# Events Server - With WebSocket
server {
listen 80;
server_name events.domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name events.domain.com;
ssl_certificate /etc/letsencrypt/live/events.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/events.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://localhost:7264;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_read_timeout 3600;
proxy_send_timeout 3600;
}
}
# Monograph Server - With Cache
server {
listen 80;
server_name mono.domain.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name mono.domain.com;
ssl_certificate /etc/letsencrypt/live/mono.domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mono.domain.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
location / {
proxy_pass http://localhost:6264;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_cache_valid 200 60m;
add_header X-Cache-Status $upstream_cache_status;
expires 1h;
add_header Cache-Control "public, no-transform";
}
} Step 4: Test the ConfigurationBefore reloading Nginx, test the configuration to ensure there are no errors. sudo nginx -t Step 5: Reload NginxIf the configuration is correct, reload Nginx to apply the changes. sudo systemctl reload nginx Step 6: Configure Automatic Renewalsudo certbot renew --dry-run |
Hello.
There is no discussion section, so I am posting this here.
I wanted to self-host a Notesnook sync server really badly, but I'm a noob. So, I worked hard on it and came up with this noob-proof tutorial on how to set up a Notesnook sync server with local file storage, getting inspiration from the provided docker-compose in the repository.
That's my way of giving back to the self-hosting community. I hope it can help some people.
Devs, please correct me if needed.
Overview
This guide will help you set up a self-hosted instance of Notesnook using Docker Compose.
Prerequisites
1. Directory Structure Setup
Create the required directories:
2. Configuration Files
2.1. Environment File
Create the
.env
file:Add the following content (modify the values accordingly):
2.2. Docker Compose File
Create the
docker-compose.yml
file:Paste the following content:
3. Docker Images Preparation
Pull all required images to avoid timeout issues:
or just
4. Deployment
Start the services:
5. Service Verification
5.1. Check Container Status
Expected status:
notesnook-db
notesnook-s3
identity-server
notesnook-server
sse-server
monograph-server
Exit 0
):validate
initiate-rs0
setup-s3
5.2. Check Logs
5.3. Test MinIO Access
Visit:
http://your-server:9009/
6. Reverse Proxy Configuration with Nginx and SSL
Enable WebSockets Support for:
notes.domain.com (port 5264) - For real-time synchronization
events.domain.com (port 7264) - For real-time notifications
Enable Cache Assets for: mono.domain.com (port 6264) - For optimizing public notes loading
Step 1: Install Certbot
Step 2: Obtain SSL Certificates
Step 3: Modify Nginx Configuration
Use the following example configurations for each subdomain:
7. Useful Commands
Service Management
8. Maintenance
8.1. Backup
Regularly backup these directories:
/srv/Files/Notesnook/db/
(MongoDB data)/srv/Files/Notesnook/s3/
(MinIO data)/srv/Files/Notesnook/setup/.env
(Configuration)8.2. Updates
To update all services:
9. Troubleshooting
Common Issues:
Service won't start
docker compose logs [service-name]
Database Connection Issues
docker compose logs notesnook-db
.Storage Issues
docker compose logs notesnook-s3
.Email Not Working
.env
.Security Notes
.env
..env
file secure.fail2ban
.Support
If you encounter issues:
The text was updated successfully, but these errors were encountered: