5 pkgin should have been installed by the NetBSD installer if you selected
6 the right options. If it isn't installed, install it using pkg_add.
8 Note that `postgresql11-contrib` is needed for the Postgres extensions
11 The `mksh` shell is needed to run the Elixir `mix` script.
13 `# pkgin install acmesh elixir git-base git-docs mksh nginx postgresql11-server postgresql11-client postgresql11-contrib sudo ffmpeg4 ImageMagick`
15 You can also build these packages using pkgsrc:
17 databases/postgresql11-contrib
18 databases/postgresql11-client
19 databases/postgresql11-server
30 Copy the rc.d scripts to the right directory:
33 # cp /usr/pkg/share/examples/rc.d/nginx /usr/pkg/share/examples/rc.d/pgsql /etc/rc.d
36 Add nginx and Postgres to `/etc/rc.conf`:
43 ## Configuring postgres
45 First, run `# /etc/rc.d/pgsql start`. Then, `$ sudo -Hu pgsql -g pgsql createdb`.
47 ### Install media / graphics packages (optional, see [`docs/installation/optional/media_graphics_packages.md`](../installation/optional/media_graphics_packages.md))
49 `# pkgin install ImageMagick ffmpeg4 p5-Image-ExifTool`
51 ## Configuring Pleroma
53 Create a user for Pleroma:
57 # useradd -d /home/pleroma -m -g pleroma -s /usr/pkg/bin/mksh pleroma
58 # echo 'export LC_ALL="en_GB.UTF-8"' >> /home/pleroma/.profile
59 # su -l pleroma -c $SHELL
66 $ git clone -b stable https://git.pleroma.social/pleroma/pleroma.git
69 Configure Pleroma. Note that you need a domain name at this point:
72 $ cd /home/pleroma/pleroma
74 $ mix pleroma.instance gen # You will be asked a few questions here.
77 Since Postgres is configured, we can now initialize the database. There should
78 now be a file in `config/setup_db.psql` that makes this easier. Edit it, and
79 *change the password* to a password of your choice. Make sure it is secure, since
80 it'll be protecting your database. Now initialize the database:
83 $ sudo -Hu pgsql -g pgsql psql -f config/setup_db.psql
86 Postgres allows connections from all users without a password by default. To
87 fix this, edit `/usr/pkg/pgsql/data/pg_hba.conf`. Change every `trust` to
90 Once this is done, restart Postgres with `# /etc/rc.d/pgsql restart`.
92 Run the database migrations.
93 You will need to do this whenever you update with `git pull`:
96 $ MIX_ENV=prod mix ecto.migrate
101 Install the example configuration file
102 `/home/pleroma/pleroma/installation/pleroma.nginx` to
103 `/usr/pkg/etc/nginx.conf`.
105 Note that it will need to be wrapped in a `http {}` block. You should add
106 settings for the nginx daemon outside of the http block, for example:
110 error_log /var/log/nginx/error.log;
119 * Change `ssl_certificate` and `ssl_trusted_certificate` to
120 `/etc/nginx/tls/fullchain`.
121 * Change `ssl_certificate_key` to `/etc/nginx/tls/key`.
122 * Change `example.tld` to your instance's domain name.
124 ## Configuring acme.sh
126 We'll be using acme.sh in Stateless Mode for TLS certificate renewal.
128 First, get your account fingerprint:
131 $ sudo -Hu nginx -g nginx acme.sh --register-account
134 You need to add the following to your nginx configuration for the server
138 location ~ ^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$ {
139 default_type text/plain;
140 return 200 "$1.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd";
144 Replace the string after after `$1.` with your fingerprint.
149 # /etc/rc.d/nginx start
152 It should now be possible to issue a cert (replace `example.com`
153 with your domain name):
156 $ sudo -Hu nginx -g nginx acme.sh --issue -d example.com --stateless
159 Let's add auto-renewal to `/etc/daily.local`
160 (replace `example.com` with your domain):
163 /usr/pkg/bin/sudo -Hu nginx -g nginx \
164 /usr/pkg/sbin/acme.sh -r \
166 --cert-file /etc/nginx/tls/cert \
167 --key-file /etc/nginx/tls/key \
168 --ca-file /etc/nginx/tls/ca \
169 --fullchain-file /etc/nginx/tls/fullchain \
173 ## Creating a startup script for Pleroma
175 Copy the startup script to the correct location and make sure it's executable:
178 # cp /home/pleroma/pleroma/installation/netbsd/rc.d/pleroma /etc/rc.d/pleroma
179 # chmod +x /etc/rc.d/pleroma
182 Add the following to `/etc/rc.conf`:
186 pleroma_home="/home/pleroma"
187 pleroma_user="pleroma"
190 Run `# /etc/rc.d/pleroma start` to start Pleroma.
194 Restart nginx with `# /etc/rc.d/nginx restart` and you should be up and running.
196 If you need further help, contact niaa on freenode.
198 Make sure your time is in sync, or other instances will receive your posts with
199 incorrect timestamps. You should have ntpd running.
201 ## Instances running NetBSD
203 * <https://catgirl.science>
207 {! backend/installation/further_reading.include !}
211 Questions about the installation or didn’t it work as it should be, ask in [#pleroma:matrix.org](https://matrix.heldscal.la/#/room/#freenode_#pleroma:matrix.org) or IRC Channel **#pleroma** on **Freenode**.