|
1 |
| -# Installing Aleph-VM on a server / Debian 11 Bullseye |
2 |
| - |
3 |
| -## 0. Introduction |
4 |
| - |
5 |
| -For production using official Debian packages. |
6 |
| - |
7 |
| -## 1. Requirements |
8 |
| - |
9 |
| -- A [supported Linux server](../src/aleph/vm/orchestrator/README.md#1-supported-platforms) |
10 |
| -- A public domain name from a registrar and top level domain you trust. |
11 |
| - |
12 |
| -In order to run an official Aleph.im Compute Resource Node (CRN), you will also need the following resources: |
13 |
| - |
14 |
| -- CPU (2 options): |
15 |
| - - Min. 8 cores / 16 threads, 3.0 ghz+ CPU (gaming CPU for fast boot-up of microVMs) |
16 |
| - - Min. 12 core / 24 threads, 2.4ghz+ CPU (datacenter CPU for multiple concurrent loads) |
17 |
| -- RAM: 64GB |
18 |
| -- STORAGE: 1TB (NVMe SSD preferred, datacenter fast HDD possible under conditions, you’ll want a big and fast cache) |
19 |
| -- BANDWIDTH: Minimum of 500 MB/s |
20 |
| - |
21 |
| -You will need a public domain name with access to add TXT and wildcard records. |
22 |
| - |
23 |
| -> 💡 This documentation will use the invalid `vm.example.org` domain name. Replace it when needed. |
24 |
| -
|
25 |
| -## 2. Installation |
26 |
| - |
27 |
| -Run the following commands as `root`: |
28 |
| - |
29 |
| -First install the [VM-Connector](../vm_connector/README.md) using Docker: |
30 |
| -```shell |
31 |
| -apt update |
32 |
| -apt upgrade |
33 |
| -apt install -y docker.io apparmor-profiles |
34 |
| -docker run -d -p 127.0.0.1:4021:4021/tcp --restart=always --name vm-connector alephim/vm-connector:alpha |
35 |
| -``` |
36 |
| - |
37 |
| -Then install the [VM-Supervisor](../src/aleph/vm/orchestrator/README.md) using the official Debian package. |
38 |
| -The procedure is similar for updates. |
39 |
| -```shell |
40 |
| -wget -P /opt https://github.com/aleph-im/aleph-vm/releases/download/0.3.1/aleph-vm.debian-11.deb |
41 |
| -apt install /opt/aleph-vm.debian-11.deb |
42 |
| -``` |
43 |
| - |
44 |
| -Reboot if required (new kernel, ...). |
45 |
| - |
46 |
| -### Configuration |
47 |
| - |
48 |
| -Update the configuration in `/etc/aleph-vm/supervisor.env` using your favourite editor. |
49 |
| - |
50 |
| -#### Hostname |
51 |
| - |
52 |
| -You will want to insert your domain name in the form of: |
53 |
| -``` |
54 |
| -ALEPH_VM_DOMAIN_NAME=vm.example.org |
55 |
| -``` |
56 |
| - |
57 |
| -#### Network configuration |
58 |
| - |
59 |
| -On some systems, the default network interface is not `eth0` and you will want to configure the default interface |
60 |
| -by adding: |
61 |
| -``` |
62 |
| -ALEPH_VM_NETWORK_INTERFACE=enp0s1 |
63 |
| -``` |
64 |
| -(don't forget to replace `enp0s1` with the name of your default network interface). |
65 |
| - |
66 |
| -Debian 11 by default uses `/etc/resolv.conf` for DNS resolution. The VM Supervisor uses this by default. |
67 |
| -If your system uses [systemd-resolved](https://manpages.debian.org/bullseye/systemd/systemd-resolved.8.en.html) |
68 |
| -instead, uncomment and add the following setting: |
69 |
| -``` |
70 |
| -#ALEPH_VM_DNS_RESOLUTION=resolvctl |
71 |
| -``` |
72 |
| - |
73 |
| -> 💡 You can instead specify the DNS resolvers used by the VMs using `ALEPH_VM_DNS_NAMESERVERS=["1.2.3.4", "5.6.7.8"]`. |
74 |
| -
|
75 |
| -#### Volumes and partitions |
76 |
| - |
77 |
| -Two directories are used to store data from the network: |
78 |
| -- `/var/lib/aleph/vm` contains all the execution and persistent data. |
79 |
| -- `/var/cache/aleph/vm` contains data downloaded from the network. |
80 |
| - |
81 |
| -These two directories must be stored on the same partition. |
82 |
| -That partition must meet the minimum requirements specified for a CRN. |
83 |
| - |
84 |
| -> 💡 This is required due to the software using hard links to optimize performance and disk usage. |
85 |
| -
|
86 |
| -#### Applying changes |
87 |
| - |
88 |
| -Finally, restart the service: |
89 |
| -```shell |
90 |
| -systemctl restart aleph-vm-supervisor |
91 |
| -``` |
92 |
| - |
93 |
| -## 3. Reverse Proxy |
94 |
| - |
95 |
| -We document how to use Caddy as a reverse proxy since it manages and renews HTTPS certificates automatically. |
96 |
| - |
97 |
| -Any other reverse-proxy (Nginx, HAProxy, Apache2, ...) should do the job as well, just make sure to renew the |
98 |
| -HTTPS/TLS certificates on time. |
99 |
| - |
100 |
| -First, create a domain name that points to the server on IPv4 (A) and IPv6 (AAAA). |
101 |
| - |
102 |
| -This is a simple configuration. For more options, check [CONFIGURE_CADDY.md](/CONFIGURE_CADDY.md). |
103 |
| - |
104 |
| -Again, run these commands as `root`: |
105 |
| -```shell |
106 |
| - apt install -y debian-keyring debian-archive-keyring apt-transport-https |
107 |
| -curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg |
108 |
| -curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list |
109 |
| -apt update |
110 |
| -apt install caddy |
111 |
| -``` |
112 |
| - |
113 |
| -Then, after replacing the domain `vm.example.org` with your own, use configure Caddy: |
114 |
| -```shell |
115 |
| -cat >/etc/caddy/Caddyfile <<EOL |
116 |
| -{ |
117 |
| - https_port 443 |
118 |
| - on_demand_tls { |
119 |
| - interval 60s |
120 |
| - burst 5 |
121 |
| - } |
122 |
| -} |
123 |
| -vm.example.org:443 { |
124 |
| - reverse_proxy http://127.0.0.1:4020 { |
125 |
| - # Forward Host header to the backend |
126 |
| - header_up Host {host} |
127 |
| - } |
128 |
| -} |
129 |
| -EOL |
130 |
| -``` |
131 |
| -Finally, restart Caddy to use the new configuration: |
132 |
| -```shell |
133 |
| -systemctl restart caddy |
134 |
| -``` |
135 |
| - |
136 |
| -## 4. Test |
137 |
| - |
138 |
| -Open https://[YOUR DOMAIN] in a web browser, wait for diagnostic to complete and look for |
139 |
| - |
140 |
| ->  |
141 |
| -
|
142 |
| -If you face an issue, check the logs of the different services for errors: |
143 |
| - |
144 |
| -VM-Supervisor: |
145 |
| -```shell |
146 |
| -journalctl -f -u aleph-vm-supervisor.service |
147 |
| -``` |
148 |
| - |
149 |
| -Caddy: |
150 |
| -```shell |
151 |
| -journalctl -f -u caddy.service |
152 |
| -``` |
153 |
| - |
154 |
| -VM-Connector: |
155 |
| -```shell |
156 |
| -docker logs -f vm-connector |
157 |
| -``` |
158 |
| - |
159 |
| -### Common errors |
160 |
| - |
161 |
| -#### "Network interface eth0 does not exist" |
162 |
| - |
163 |
| -Did you update the configuration file `/etc/aleph-vm/supervisor.env` with `ALEPH_VM_NETWORK_INTERFACE` equal to |
164 |
| -the default network interface of your server ? |
165 |
| - |
166 |
| -#### "Aleph Connector unavailable" |
167 |
| - |
168 |
| -Investigate the installation of the VM-Connector using Docker in step 2. |
| 1 | +[[https://docs.aleph.im/nodes/compute/installation/debian-11/]] |
0 commit comments