You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/production.mdx
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,53 @@ However, at build time, there are some fairly memory-intensive tasks which _will
33
33
34
34
At **build**, hyperglass consumes approximately **196 MB** of storage. 194 MB of this is front-end dependencies, which are downloaded and installed when running a UI build. The other 2 MB is the hyperglass code itself. Once again, the minimum system requirements for most Linux distributions should be sufficient.
35
35
36
+
## systemd
37
+
38
+
More than likely, you'll want to run hyperglass as a background system service. [systemd](https://systemd.io/) is one of the most common ways of running services on Linux. To run hyperglass as a systemd service, create a file named `hyperglass.service` in your [installation directory](setup.mdx#installation-directory) and add following to it:
39
+
40
+
```ini
41
+
[Unit]
42
+
Description=hyperglass
43
+
After=network.target
44
+
Requires=redis-server
45
+
# Replace the above with Requires=redis for CentOS
46
+
47
+
[Service]
48
+
User=<user or root>
49
+
Group=<user or root>
50
+
ExecStart=<path to hyperglass> start
51
+
52
+
[Install]
53
+
WantedBy=multi-user.target
54
+
```
55
+
56
+
Replace `<user or root>` with whichever user you're running hyperglass as. For example, if you're running hyperglass as a non-root user, you probably used `pip3 install hyperglass` (without `sudo`) to install hyperglass, and you're probably using `~/hyperglass` as your installation directory. However, if you're running hyperglass as root, you probably used `sudo pip3 install hyperglass` to install hyperglass, and you're probably using `/etc/hyperglass` as your installation directory.
57
+
58
+
Systemd requires an absolute path for executables. This means you can't just put `hyperglass start` in the `ExecStart` field, it needs to be the full path. The easiest way to get this is to run `which hyperglass`, which will output the full path. It should look something like `/home/username/.local/bin/hyperglass` or `/usr/local/bin/hyperglass`.
59
+
60
+
After adding the file, run the following:
61
+
62
+
```bash
63
+
# Replace <systemd file> with the path to the systemd file you just created.
# Tell systemd to re-look at its service files, since you just added one.
67
+
sudo systemctl daemon-reload
68
+
69
+
# Tell systemd to run hyperglass on system startup.
70
+
sudo systemctl enable hyperglass
71
+
72
+
# Start the hyperglass service.
73
+
sudo systemctl start hyperglass
74
+
75
+
# Check the status of the hyperglass service.
76
+
sudo systemctl status hyperglass
77
+
```
78
+
79
+
:::important Checking the status
80
+
The first time hyperglass starts up, it will run through a UI build process, which will take a little time. You may have to wait a couple of minutes in between each check on hyperglass's status.
81
+
:::
82
+
36
83
## Reverse Proxy
37
84
38
85
You'll want to run hyperglass behind a reverse proxy in production to serve the static files more efficiently and offload SSL. Any reverse proxy should work, but hyperglass has been specifically tested with [Caddy](https://caddyserver.com/) and [NGINX](https://www.nginx.com/). Sample configs for both can be found below.
Copy file name to clipboardExpand all lines: docs/docs/setup.mdx
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,18 +44,6 @@ You'll receive the following prompts:
44
44
45
45
hyperglass requires a directory on your system to store configuration files, the web UI, logos, etc. You may choose between the current user's home directory or `/etc`.
46
46
47
-
### Systemd Service
48
-
49
-
```shell-session
50
-
Do you want to generate a systemd service file? [y/N]:
51
-
```
52
-
53
-
hyperglass also includes a [systemd](https://systemd.io/) service file, which can be installed if you use systemd. If selected, a systemd service file will be generated and copied to the installation directory. Then, it will be symlinked to `/etc/systemd/system`. All you need to do to enable the service is run:
54
-
55
-
```shell-session
56
-
$ sudo systemctl enable hyperglass
57
-
```
58
-
59
47
## UI Build
60
48
61
49
After running the setup, the `build-ui` command needs to be run for the first time. This command creates the required file structure for the UI, initializes frontend dependencies, and generates favicons.
@@ -80,3 +68,7 @@ hyperglass won't start without a `devices.yaml` file. See the [Adding Devices](a
80
68
```shell-session
81
69
$ hyperglass start
82
70
```
71
+
72
+
:::tip Production
73
+
Remember to check the [Production](production.mdx) section for instructions on how to run hyperglass in production. It includes instructions and examples for setting up a Reverse Proxy (such as NGINX or Caddy), and running hyperglass as a system service with systemd.
0 commit comments