Wiki » History » Revision 2
Revision 1 (Gareth Eaton, 07/12/2023 12:35 PM) → Revision 2/15 (Gareth Eaton, 07/12/2023 12:35 PM)
h1. Wiki Install To install Bitwarden on a Proxmox server, you can follow these general steps: 1. Set up a Linux container (LXC) on your Proxmox server. Bitwarden supports various Linux distributions, such as Ubuntu or Debian, so you can choose the one you are most comfortable with. For example, if you want to use Ubuntu, you can create an Ubuntu LXC container. 2. Once the LXC container is created, log in to the container via SSH or the Proxmox web interface. 3. Update the package repositories and upgrade the system by running the following commands: <pre> sudo apt update sudo apt upgrade </pre> 4. Install the required dependencies. Bitwarden requires Docker and Docker Compose. Install them using the following commands: <pre> sudo apt install docker.io sudo apt install docker-compose </pre> 5. Start the Docker service: <pre> sudo systemctl start docker </pre> 6. Create a directory to store the Bitwarden configuration and data: <pre> sudo mkdir /opt/bitwarden </pre> 7. Change the ownership of the directory to the user running Docker: <pre> sudo chown 1000:1000 /opt/bitwarden </pre> 8. Navigate to the Bitwarden directory: <pre> cd /opt/bitwarden </pre> 9. Download the Bitwarden Docker Compose file: <pre> sudo curl -Lso docker-compose.yml https://raw.githubusercontent.com/bitwarden/server/master/docker/docker-compose.yml </pre> 10. Open the docker-compose.yml file using a text editor. For instance: <pre> sudo nano docker-compose.yml </pre> Add the following... if you want to make Bitwarden accessible at IP address 192.168.1.69, modify the ports configuration for the <pre> services: '404': image: bitwarden/setup:latest # Rest of the service configuration services: bitwarden: image: bitwardenrs/server:latest container_name: bitwarden ports: - 192.168.1.69:80:80 # Other configuration options for the Bitwarden service </pre> 11. Save and close the Docker Compose file. 12. Start the Bitwarden containers using Docker Compose: Swich to the docker folder <pre> cd /opt/bitwarden </pre> <pre> sudo docker-compose up -d </pre> 13. Wait for the containers to start and initialize. You can check the status by running: <pre> sudo docker-compose ps </pre> 14. Once the containers are up and running, you should be able to access Bitwarden by visiting the IP address or domain name of your Proxmox server in a web browser. Make sure to use HTTPS for secure access. That's it! You have successfully installed Bitwarden on your Proxmox server. Remember to configure any necessary firewall rules to allow external access to the Bitwarden service, and consider setting up SSL/TLS certificates for secure communication. --- By default, the Bitwarden containers will not start automatically after a server reboot. However, you can configure them to start automatically on server boot by using systemd services. Here's a step-by-step guide to setting up systemd services for Bitwarden: Create a systemd service unit file for Bitwarden. Open a new file with a .service extension using a text editor, such as bitwarden.service: <pre> sudo nano /etc/systemd/system/bitwarden.service </pre> Add the following content to the bitwarden.service file. Make sure to adjust the paths based on your specific configuration: <pre> [Unit] Description=Bitwarden Service After=network.target [Service] Type=simple ExecStart=/usr/bin/docker-compose -f /opt/bitwarden/docker-compose.yml up WorkingDirectory=/opt/bitwarden User=root Restart=always [Install] WantedBy=multi-user.target </pre> Save the changes and exit the text editor. Enable the systemd service to start on boot: <pre> sudo systemctl enable bitwarden.service </pre> Start the Bitwarden systemd service: <pre> sudo systemctl start bitwarden.service </pre> With these steps, the Bitwarden containers should now start automatically when the server reboots. The systemd service will ensure that the docker-compose up command is executed with the appropriate configuration. You can use the following commands to manage the Bitwarden systemd service: Start the service: sudo systemctl start bitwarden.service Stop the service: sudo systemctl stop bitwarden.service Restart the service: sudo systemctl restart bitwarden.service Check the status of the service: sudo systemctl status bitwarden.service Remember to adjust the paths and configurations in the bitwarden.service file to match your specific setup. After configuring the systemd service, you can test it by rebooting the server and verifying that Bitwarden starts automatically.