KeeWeb is a lightweight, open-source, self-hosted password manager designed for both personal and professional use. Its versatility lies in its ability to work seamlessly with KeePass files, customization for specific needs, and the control it provides over sensitive data. In this guide, weβll walk through installing KeeWeb, configuring it with Nginx as a reverse proxy, enabling logging, setting up backups, updating the app, and leveraging its standout features.
Installing KeeWeb
π¦ Docker/Docker Compose Setup
Using Docker Compose is the easiest way to deploy KeeWeb. Hereβs how to set it up:
- Create a new directory for your KeeWeb setup:
mkdir -p ~/keeweb && cd ~/keeweb
- Create a
docker-compose.yml
file:
version: '3.8'
services:
keeweb:
image: antelle/keeweb
container_name: keeweb
ports:
- "8080:80"
volumes:
- ./data:/data
restart: unless-stopped
- Deploy KeeWeb:
docker-compose up -d
- Verify the container is running:
docker ps | grep keeweb
Your KeeWeb instance will now be accessible at http://<your-server-ip>:8080
.
π Manual Installation
For those who prefer direct installation, follow these steps to install KeeWeb on a Linux server:
- Install dependencies (Node.js, npm, and Git):
sudo apt update
sudo apt install -y nodejs npm git
- Clone the KeeWeb repository:
git clone https://github.com/keeweb/keeweb.git
cd keeweb
- Build the application:
npm install
npm run build
- Serve KeeWeb using a static file server, such as Nginx or Apache:
npx http-server dist
You can now access KeeWeb by navigating to your serverβs IP or hostname.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To route traffic to KeeWeb, create an Nginx server block:
- Edit or create a configuration file:
sudo nano /etc/nginx/sites-available/keeweb
- Add the following content:
server {
listen 80;
server_name keeweb.yourdomain.com;
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Enable the configuration:
sudo ln -s /etc/nginx/sites-available/keeweb /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your KeeWeb instance with Letβs Encrypt:
- Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
- Obtain and configure an SSL certificate:
sudo certbot --nginx -d keeweb.yourdomain.com
- Automate certificate renewal:
sudo systemctl enable certbot.timer
Logging and Debugging KeeWeb
ποΈ Enabling Debug Logs
Enable debug-level logging by setting the LOG_LEVEL
environment variable in your Docker Compose file:
environment:
- LOG_LEVEL=debug
Restart the container to apply changes:
docker-compose restart keeweb
π Viewing Logs
To view logs for KeeWeb:
- Docker logs:
docker logs keeweb
- For a manual setup, check logs in the terminal where itβs running.
π οΈ Troubleshooting Common Issues
Look for common error messages in the logs, such as:
-
Missing files or permissions.
-
Incorrect proxy settings in Nginx.
For persistent problems, ensure all dependencies are installed correctly and access permissions are configured.
Backup and Restore
ποΈ File-Based Backups
KeeWeb primarily uses files for its configuration and data. Backup the data
folder in Docker:
tar -cvzf keeweb-backup.tar.gz ~/keeweb/data
π Restoring Backups
To restore, extract the archive:
tar -xvzf keeweb-backup.tar.gz -C ~/keeweb/data
Then restart the Docker container:
docker-compose restart keeweb
π Automated Backup Scripts
Automate backups with a cron job:
crontab -e
Add the following line:
0 2 * * * tar -cvzf ~/keeweb-backup-$(date +\%F).tar.gz ~/keeweb/data
Updating and Upgrading KeeWeb
β¬οΈ Updating Docker Images
Update the KeeWeb Docker image:
docker-compose pull
docker-compose up -d
π οΈ Manual Updates
For manually installed versions, pull the latest changes:
cd ~/keeweb
git pull
npm install
npm run build
π Checking for Updates
Visit KeeWebβs GitHub repository to track releases:
https://github.com/keeweb/keeweb/releases
Leveraging KeeWebβs Unique Features
π§ Enabling APIs
If you want to enable KeeWebβs public API for automation, modify the configuration file:
{
"api": { "enabled": true }
}
π Advanced Configurations
Customize KeeWeb by editing its configuration file (config.json
):
{
"theme": "dark",
"autoSave": true
}
Reload KeeWeb to apply changes.
Wrapping Up
By following this guide, youβve successfully deployed, customized, and secured KeeWeb on your own server. Whether youβre managing personal credentials or enterprise-level secrets, KeeWebβs self-hosted model ensures flexibility, privacy, and control. Start implementing these steps today to unlock the full potential of KeeWeb for your workflow.