Automated Vaultwarden Install!
This will aid and install the free version of Bitwarden (Vaultwarden) This is for Debian based distros
First get these packages
apt-get update
apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg \
lsb-release \
nano
Now install script
wget https://raw.githubusercontent.com/gorgdel/Vaultwarden-Automated/master/vaultwardeninstall.sh -O vaultwardeninstall.sh && chmod +x vaultwardeninstall.sh && ./vaultwardeninstall.sh
This will install Vaultwarden, NginxProxyManager, Docker and Portainer
- Portainer - An awesome GUI interface that allows you to manage your docker containers.
- NginxProxyManger - Another GUI interface, this time NGINX, which allows you to add certs, generate Let's Encrypt Certs and create the reverse proxy to allow Vaultwarden to work.
- Docker/Docker-Compose - The brains of the install, docker allows for all the containers to work.
- Vaultwarden (free version of bitwarden) - The password repository.
wget https://raw.githubusercontent.com/gorgdel/Vaultwarden-Automated/master/vaultwardeninstall.sh -O vaultwardeninstall.sh && chmod +x vaultwardeninstall.sh && ./vaultwardeninstall.sh
Once install is complete:
Hostname -I
This will return your IP Address. Start by entering your IP into a browser with port 9000.
192.168.0.1:9000
This will take you to the Portainer home-page. Create a user. Within here, you can see your containers, vaultwarden and nginx should be enabled.
Connect to NginxProxyManager
192.168.0.1:81
Default Login
Email: [email protected]
Password: changeme
You can just use letsencrypt, if you run into errors, ensure
> port 80 is port forwarded/exposed.
> You haven't been timed out due to too many "challenges"
-
Select SSL Certificates
-
Add SSL Certificate > Custom
-
Set a name > Upload the private key file (unencrypted) Upload the certificate file (.cer or .crt) Upload the Intermediate Certificate OR Create Let's Encrypt Cert.
-
Hosts > Proxy Hosts > Add Proxy Host
-
"Details" tab: Domain Names - (set the domain name you want) Scheme - http Forward Hostname/IP - 192.168.0.xxx Forward Port - 80
-
"SSL" tab: Select the previously created SSL Certificate, Enable "Force SSL" and "HTTP/2 Support"
This will allow for you to change config data through a GUI. Firstly generate a token and save it.
openssl rand -base64 48
Copy this "token" Example: s6JsBPLYE7roF+jVaFYLY+SbAgQWI4qfUlVi/1QrOMlQ9yrFKMqH2UJ0kBmZ/dTS
nano /vw-data/config.json
Use arrow keys and go to last line
"_enable_email_2fa": false,
"email_token_size": 6,
"email_expiration_time": 600,
"email_attempts_limit": 3
}
We will generate a token using Add a new variable "admin_token": (token) (make sure to add a comma to last line)
"_enable_email_2fa": false,
"email_token_size": 6,
"email_expiration_time": 600,
"email_attempts_limit": 3,
"admin_token": s6JsBPLYE7roF+jVaFYLY+SbAgQWI4qfUlVi/1QrOMlQ9yrFKMqH2UJ0kBmZ/dTS
}
Docker restart vaultwarden
Now go to yourdomain.com/admin Paste your token in and you will get to the admin portal. To disable admin portal, remove "admin_token" and remove comma from "email_attempts_limit"