NavWeb is a lightweight, self-hosted web application designed to enable customizable navigation systems for managing and visualizing data workflows. Its modular design and robust APIs make it a popular choice for developers and system administrators looking for control, privacy, and adaptability. In this guide, weβll walk you through installing, configuring, and managing NavWeb, covering everything from deployment to advanced features.
Installing NavWeb
π¦ Docker/Docker Compose Setup
Using Docker Compose is the most efficient way to deploy NavWeb. Below is a docker-compose.yml
file that sets up NavWeb with persistent volumes and environment variables.
version: '3.9'
services:
navweb:
image: navweb:latest
container_name: navweb
ports:
- "8080:8080"
volumes:
- ./navweb_data:/data
- ./navweb_config:/config
environment:
- NAVWEB_ENV=production
- NAVWEB_LOG_LEVEL=info
restart: unless-stopped
Run the following commands to deploy NavWeb:
mkdir navweb && cd navweb
## Save the docker-compose.yml file
nano docker-compose.yml
## Start the service
docker-compose up -d
## Check the status
docker ps
π Manual Installation
For direct server installation, follow these steps to install NavWeb on a Linux machine:
- Install dependencies:
sudo apt update
sudo apt install -y git curl unzip
- Download and extract NavWeb:
curl -L https://github.com/navweb/navweb/releases/latest/download/navweb-linux-amd64.zip -o navweb.zip
unzip navweb.zip -d /opt/navweb
sudo chmod +x /opt/navweb/navweb
- Create a systemd service:
sudo nano /etc/systemd/system/navweb.service
Add the following content:
[Unit]
Description=NavWeb Service
After=network.target
[Service]
ExecStart=/opt/navweb/navweb --config /opt/navweb/config.yaml
Restart=on-failure
[Install]
WantedBy=multi-user.target
- Start and enable the service:
sudo systemctl daemon-reload
sudo systemctl start navweb
sudo systemctl enable navweb
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
Set up Nginx to route traffic to NavWeb. Create a server block configuration:
sudo nano /etc/nginx/sites-available/navweb
Add the following content:
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Enable the configuration and restart Nginx:
sudo ln -s /etc/nginx/sites-available/navweb /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
π SSL/TLS Setup
Use Certbot to secure NavWeb with a free Let's Encrypt certificate:
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com
Automate the renewal process:
sudo systemctl enable certbot.timer
π οΈ Testing and Reloading Nginx
Verify and reload Nginx after any changes:
sudo nginx -t
sudo systemctl reload nginx
Logging and Debugging NavWeb
ποΈ Enabling Debug Logs
Modify the logging level in the NavWeb configuration file:
nano /opt/navweb/config.yaml
Set the log_level
to debug
:
log_level: debug
Restart NavWeb to apply changes:
sudo systemctl restart navweb
π Viewing Logs
Access logs using the following methods:
- For Docker:
docker logs navweb
- For manual installation:
tail -f /opt/navweb/logs/navweb.log
π οΈ Troubleshooting Common Issues
Analyze logs for errors like port conflicts or configuration issues. For example:
grep "ERROR" /opt/navweb/logs/navweb.log
π€ Exporting Logs
Export logs to an external ELK stack using Filebeat:
sudo apt install filebeat
sudo filebeat setup -e
Edit the Filebeat configuration to include NavWeb logs:
filebeat.inputs:
- type: log
paths:
- /opt/navweb/logs/*.log
Backup and Restore
ποΈ File-Based Backups
Backup configuration and data directories:
tar -czvf navweb_backup.tar.gz /opt/navweb/config.yaml /opt/navweb/data
Restore the backup:
tar -xzvf navweb_backup.tar.gz -C /
π Database Backups
If NavWeb uses a database, back it up with:
sqlite3 /opt/navweb/data/navweb.db .dump > navweb_backup.sql
Restore it:
sqlite3 /opt/navweb/data/navweb.db < navweb_backup.sql
π Automated Backup Scripts
Set up a cron job for periodic backups:
crontab -e
Add the following line:
0 2 * * * tar -czvf /backups/navweb_$(date +\%F).tar.gz /opt/navweb/config.yaml /opt/navweb/data
Updating and Upgrading NavWeb
β¬οΈ Updating Docker Images
To update NavWebβs Docker image:
docker-compose pull
docker-compose down
docker-compose up -d
π οΈ Manual Updates
For manual installations:
curl -L https://github.com/navweb/navweb/releases/latest/download/navweb-linux-amd64.zip -o navweb.zip
unzip navweb.zip -d /opt/navweb
sudo systemctl restart navweb
π Checking for Updates
Check for updates in NavWebβs web dashboard or GitHub repository:
curl -s https://api.github.com/repos/navweb/navweb/releases/latest | grep tag_name
Leveraging NavWebβs Unique Features
π§ Enabling APIs
Activate NavWebβs API by updating the configuration file:
api:
enabled: true
auth: token
Restart the app:
sudo systemctl restart navweb
Access the API with curl
:
curl -H "Authorization: Bearer <TOKEN>" http://example.com/api/v1/status
π Advanced Configurations
Enable advanced features like custom themes or third-party integrations:
ui:
theme: dark
integrations:
webhook: https://example.com/webhook
Wrapping Up
Self-hosting NavWeb gives you unparalleled flexibility and control over your navigation and data management workflows. By following the steps outlined in this guide, you now have the tools to deploy, configure, and manage NavWeb effectively. From securing your instance with SSL to leveraging advanced features, you're ready to unlock NavWebβs full potential and customize it to suit your needs. Start exploring today!