summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralifeee <alifeee.web@outlook.com>2025-02-11 12:53:21 +0000
committeralifeee <alifeee.web@outlook.com>2025-02-11 12:53:21 +0000
commit4a127cb6d750f680811f30fe09eaadbbde99d13e (patch)
treef33b698761cc65482aef323b4e0987d11c2e16ac
parent2d7507a4fde247ea3e67c2d49df157abd60d6599 (diff)
add a bit more info to installation instructions
pertinently allowing `pnpm` to be run by anyone
-rw-r--r--docs/running-gathio/installation.md65
1 files changed, 36 insertions, 29 deletions
diff --git a/docs/running-gathio/installation.md b/docs/running-gathio/installation.md
index cdb3f44..b3f4931 100644
--- a/docs/running-gathio/installation.md
+++ b/docs/running-gathio/installation.md
@@ -6,8 +6,8 @@ Gathio can be set up to run on your own server in two ways - as a self-hosted se
### Prerequisites
-- [Node.js](https://nodejs.org/en/) v18 or greater
-- [MongoDB](https://www.mongodb.com/docs/manual/administration/install-on-linux/#std-label-install-mdb-community-edition-linux)
+- [Node.js](https://nodejs.org/en/) v18 or greater
+- [MongoDB](https://www.mongodb.com/docs/manual/administration/install-on-linux/#std-label-install-mdb-community-edition-linux)
### Ubuntu
@@ -15,64 +15,71 @@ Let's suppose we're installing on a fresh Ubuntu system.
First, let's get the code:
-```
-$ cd /srv/
-$ sudo git clone https://github.com/lowercasename/gathio/
+```bash
+cd /srv/
+sudo git clone https://github.com/lowercasename/gathio/
```
-We'll need to install [pnpm](https://pnpm.io/) for this:
+We'll need to install [`pnpm`](https://pnpm.io/) for this. It should be installed somewhere accessible by any user account. You may also have to link `/usr/bin/node` and `/usr/bin/nodejs` to be accessible to all users, too.
-```
-$ curl -fsSL https://get.pnpm.io/install.sh | sh -
+```bash
+export PNPM_HOME="/usr/.pnpm"
+curl -fsSL https://get.pnpm.io/install.sh | sh -
+sudo ln -s /usr/.pnpm/pnpm /usr/bin/pnpm
```
-pnpm installation instructions for [other systems](https://pnpm.io/installation) are available.
+`pnpm` installation instructions for [other systems](https://pnpm.io/installation) are available.
Now, we'll install the dependencies:
-```
-$ cd gathio
-$ pnpm install
-$ pnpm build
+```bash
+cd gathio
+pnpm install
+pnpm build
```
Let's copy the config file in place:
-```
-$ cp config/config.example.toml config/config.toml
+```bash
+cp config/config.example.toml config/config.toml
```
We can edit this file if needed, as it contains settings which will need to be adjusted to your local setup to successfully format emails.
-```
-$ $EDITOR config/config.toml
+```bash
+$EDITOR config/config.toml
```
Either way, we'll need to have MongoDB running. Follow the [MongoDB Community Edition Ubuntu instructions](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu), which are probably what you want.
Next, let's create a dedicated user:
-```
-$ sudo adduser --home /srv/gathio --disabled-login gathio
-$ sudo chown -R gathio:gathio /srv/gathio
+```bash
+sudo adduser --home /srv/gathio --disabled-login gathio
+sudo chown -R gathio:gathio /srv/gathio
+# check user can access pnpm
+cd / && sudo -u gathio /usr/bin/pnpm --version
```
-Next, we'll copy the systemd service and reload systemd
+Next, we'll copy the `systemd` service and reload `systemd`
-```
-$ sudo cp gathio.service /etc/systemd/system/
-$ sudo systemctl daemon-reload
+```bash
+sudo cp gathio.service /etc/systemd/system/
+sudo systemctl daemon-reload
```
-Finally, we can start gathio:
+Finally, we can start `gathio`:
-```
-$ sudo systemctl start gathio
+```bash
+# start locally in terminal
+(cd /srv/gathio; /usr/bin/pnpm start)
+# start service to run in background
+sudo systemctl start gathio
```
It should now be listening on port 3000:
-```
+```bash
$ sudo netstat -tunap | grep LISTEN
[...]
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 952/sshd
@@ -125,7 +132,7 @@ You can copy the `docker-compose.yml` file into that same `gathio-docker` direct
you created - you don't need any of the source code. Once you're done, your directory
should look something like this:
-```
+```tree
gathio-docker
├── config
│ └── config.toml