Project

General

Profile

Wiki » History » Version 1

Gareth Eaton, 07/12/2023 12:35 PM

1 1 Gareth Eaton
h1. Wiki
2
3
Install
4
5
To install Bitwarden on a Proxmox server, you can follow these general steps:
6
7
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.
8
9
2. Once the LXC container is created, log in to the container via SSH or the Proxmox web interface.
10
11
3. Update the package repositories and upgrade the system by running the following commands:
12
<pre>
13
   sudo apt update
14
   sudo apt upgrade
15
   </pre>
16
17
4. Install the required dependencies. Bitwarden requires Docker and Docker Compose. Install them using the following commands:
18
<pre>
19
   sudo apt install docker.io
20
   sudo apt install docker-compose
21
</pre>
22
23
5. Start the Docker service:
24
<pre>
25
   sudo systemctl start docker
26
</pre>
27
28
6. Create a directory to store the Bitwarden configuration and data:
29
30
<pre>
31
   sudo mkdir /opt/bitwarden
32
</pre>
33
34
7. Change the ownership of the directory to the user running Docker:
35
36
<pre>
37
   sudo chown 1000:1000 /opt/bitwarden
38
</pre>
39
40
8. Navigate to the Bitwarden directory:
41
42
<pre>
43
   cd /opt/bitwarden
44
</pre>
45
46
9. Download the Bitwarden Docker Compose file:
47
48
<pre>
49
   sudo curl -Lso docker-compose.yml https://raw.githubusercontent.com/bitwarden/server/master/docker/docker-compose.yml
50
</pre>
51
52
10. Open the docker-compose.yml file using a text editor. For instance:
53
54
<pre>
55
sudo nano docker-compose.yml
56
</pre>
57
58
Add the following... if you want to make Bitwarden accessible at IP address 192.168.1.69, modify the ports configuration for the 
59
60
<pre>
61
services:
62
  '404':
63
    image: bitwarden/setup:latest
64
    # Rest of the service configuration
65
66
services:
67
  bitwarden:
68
    image: bitwardenrs/server:latest
69
    container_name: bitwarden
70
    ports:
71
      - 192.168.1.69:80:80
72
    # Other configuration options for the Bitwarden service
73
74
</pre>
75
76
77
78
79
11. Save and close the Docker Compose file.
80
81
12. Start the Bitwarden containers using Docker Compose:
82
83
Swich to the docker folder
84
85
<pre>
86
cd /opt/bitwarden
87
</pre>
88
89
<pre>
90
   sudo docker-compose up -d
91
</pre>
92
93
13. Wait for the containers to start and initialize. You can check the status by running:
94
95
<pre>
96
   sudo docker-compose ps
97
 </pre>
98
99
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.
100
101
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.
102
103
---
104
105
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.
106
107
Here's a step-by-step guide to setting up systemd services for Bitwarden:
108
109
Create a systemd service unit file for Bitwarden. Open a new file with a .service extension using a text editor, such as bitwarden.service:
110
111
112
<pre>
113
sudo nano /etc/systemd/system/bitwarden.service
114
</pre>
115
116
Add the following content to the bitwarden.service file. Make sure to adjust the paths based on your specific configuration:
117
118
<pre>
119
120
[Unit]
121
Description=Bitwarden Service
122
After=network.target
123
124
[Service]
125
Type=simple
126
ExecStart=/usr/bin/docker-compose -f /opt/bitwarden/docker-compose.yml up
127
WorkingDirectory=/opt/bitwarden
128
User=root
129
Restart=always
130
131
[Install]
132
WantedBy=multi-user.target
133
</pre>
134
135
Save the changes and exit the text editor.
136
137
Enable the systemd service to start on boot:
138
139
<pre>
140
141
sudo systemctl enable bitwarden.service
142
</pre>
143
144
Start the Bitwarden systemd service:
145
146
147
<pre>
148
sudo systemctl start bitwarden.service
149
</pre>
150
151
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.
152
153
You can use the following commands to manage the Bitwarden systemd service:
154
155
Start the service: sudo systemctl start bitwarden.service
156
157
Stop the service: sudo systemctl stop bitwarden.service
158
159
Restart the service: sudo systemctl restart bitwarden.service
160
161
Check the status of the service: sudo systemctl status bitwarden.service
162
163
Remember to adjust the paths and configurations in the bitwarden.service file to match your specific setup.
164
165
After configuring the systemd service, you can test it by rebooting the server and verifying that Bitwarden starts automatically.