How to change the password and port for the AmneziaWG web interface?
I installed AmneziaWG on my VPS and was successfully using it for some time. However, today I encountered a problem accessing the VPN web interface:
- The password used when connecting via SSH to the server doesn’t work for the VPN web interface
- When trying to connect at http://server_IP:8880, an access error message appears
- The actual working port for the web interface is 1111
Please advise how I can change:
- The password for accessing the AmneziaWG web interface
- The port for connecting to the GUI web interface
AmneziaWG does not have a built-in web interface by default, but if you have installed a custom version with a web panel, changing the password and port usually requires access to configuration files or reinstallation of the service. To change the port, you need to edit the web server or service configuration file, and the password can be changed through the configuration file or initialization script.
Contents
- How to change the AmneziaWG web interface password
- How to change the web interface port
- Verifying functionality after changes
- Alternative configuration methods
- Troubleshooting access issues
Changing the AmneziaWG web interface password
The main methods for changing the password depend on how exactly your web interface is deployed:
Through the configuration file
-
Connect to the server via SSH:
bashssh username@your_server_ip
-
Find the web interface configuration file. It is usually located at:
/etc/amneziawg/web/config.json/opt/amneziawg-webui/config.ini/var/www/amneziawg/config.php
-
Change the password parameter in the configuration file. Example:
json{ "username": "admin", "password": "new_password_hash" } -
Restart the web service:
bashsudo systemctl restart amneziawg-web
Through the initialization script
If the web interface was installed via a script, there might be a built-in command:
sudo amneziawg-web --reset-password
or
sudo /opt/amneziawg-webui/change_pass.sh
Changing the web interface port
Method 1: Through systemd service
-
Open the service file:
bashsudo nano /etc/systemd/system/amneziawg-web.service -
Change the ExecStart parameter, specifying the new port:
ExecStart=/opt/amneziawg-webui --port=1111 -
Reload systemctl:
bashsudo systemctl daemon-reload sudo systemctl restart amneziawg-web
Method 2: Through reverse proxy (Nginx/Apache)
-
Configure Nginx proxy:
nginxserver { listen 80; server_name your_domain.com; location / { proxy_pass http://127.0.0.1:1111; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } -
Restart Nginx:
bashsudo systemctl restart nginx
Method 3: Direct change in the application
If the web interface is written in Python/Go/Node.js, find the main file and change the port:
# Example for Python application
app.run(host='0.0.0.0', port=1111)
Verifying functionality after changes
-
Check the service status:
bashsudo systemctl status amneziawg-web -
Check open ports:
bashsudo netstat -tlnp | grep 1111 -
Check logs:
bashsudo journalctl -u amneziawg-web -f -
Check accessibility through browser:
http://your_IP:1111
Important! Make sure the new port is open in the firewall:
bashsudo ufw allow 1111 sudo firewall-cmd --add-port=1111/tcp --permanent
Alternative configuration methods
Using Docker
If the web interface is running in Docker:
docker stop amneziawg-web
docker rm amneziawg-web
docker run -d -p 1111:80 --name amneziawg-web amneziawg/webui
Reinstalling the web interface
If nothing works, reinstall the web interface:
sudo apt-get remove amneziawg-webui
sudo rm -rf /opt/amneziawg-webui
curl -sSL https://raw.githubusercontent.com/amnezia-vpn/amneziawg-webui/master/install.sh | sudo bash
Troubleshooting access issues
“Password doesn’t match” problem
-
Check log files:
bashsudo tail -f /var/log/amneziawg/web.log -
Reset the password through the database (if used):
bashsudo sqlite3 /var/lib/amneziawg/users.db "UPDATE users SET password='new_hash' WHERE username='admin';" -
Check access permissions:
bashsudo chown -R www-data:www-data /var/www/amneziawg sudo chmod -R 755 /var/www/amneziawg
Port 8880 problem
If port 8880 doesn’t work but 1111 does:
-
Check which port is actually being used:
bashsudo ss -tlnp | grep amneziawg -
Find the process listening on port 1111:
bashsudo lsof -i :1111 -
Stop the incorrect service:
bashsudo systemctl stop amneziawg-web sudo systemctl disable amneziawg-web -
Start the service on the required port:
bashsudo amneziawg-web --port=1111 --daemon
Conclusion
- Changing the password and port for the AmneziaWG web interface requires access to configuration files or services
- The port is usually changed through systemd configuration or application startup parameters
- The password may be stored in a configuration file, database, or be hashed
- After any changes, be sure to restart the service and check the firewall
- If standard methods don’t work, try reinstalling the web interface or using Docker
For successful configuration, it is recommended to review the documentation for your specific AmneziaWG build, as methods may vary depending on the version and installation method.