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`
15 You can also build these packages using pkgsrc:
17 databases/postgresql11-contrib
18 databases/postgresql11-client
19 databases/postgresql11-server
29 Copy the rc.d scripts to the right directory:
32 # cp /usr/pkg/share/examples/rc.d/nginx /usr/pkg/share/examples/rc.d/pgsql /etc/rc.d
35 Add nginx and Postgres to `/etc/rc.conf`:
42 ## Configuring postgres
44 First, run `# /etc/rc.d/pgsql start`. Then, `$ sudo -Hu pgsql -g pgsql createdb`.
46 ## Configuring Pleroma
48 Create a user for Pleroma:
52 # useradd -d /home/pleroma -m -g pleroma -s /usr/pkg/bin/mksh pleroma
53 # echo 'export LC_ALL="en_GB.UTF-8"' >> /home/pleroma/.profile
54 # su -l pleroma -c $SHELL
61 $ git clone -b stable https://git.pleroma.social/pleroma/pleroma.git
64 Configure Pleroma. Note that you need a domain name at this point:
67 $ cd /home/pleroma/pleroma
69 $ mix pleroma.instance gen # You will be asked a few questions here.
72 Since Postgres is configured, we can now initialize the database. There should
73 now be a file in `config/setup_db.psql` that makes this easier. Edit it, and
74 *change the password* to a password of your choice. Make sure it is secure, since
75 it'll be protecting your database. Now initialize the database:
78 $ sudo -Hu pgsql -g pgsql psql -f config/setup_db.psql
81 Postgres allows connections from all users without a password by default. To
82 fix this, edit `/usr/pkg/pgsql/data/pg_hba.conf`. Change every `trust` to
85 Once this is done, restart Postgres with `# /etc/rc.d/pgsql restart`.
87 Run the database migrations.
88 You will need to do this whenever you update with `git pull`:
91 $ MIX_ENV=prod mix ecto.migrate
96 Install the example configuration file
97 `/home/pleroma/pleroma/installation/pleroma.nginx` to
98 `/usr/pkg/etc/nginx.conf`.
100 Note that it will need to be wrapped in a `http {}` block. You should add
101 settings for the nginx daemon outside of the http block, for example:
105 error_log /var/log/nginx/error.log;
114 * Change `ssl_certificate` and `ssl_trusted_certificate` to
115 `/etc/nginx/tls/fullchain`.
116 * Change `ssl_certificate_key` to `/etc/nginx/tls/key`.
117 * Change `example.tld` to your instance's domain name.
119 ## Configuring acme.sh
121 We'll be using acme.sh in Stateless Mode for TLS certificate renewal.
123 First, get your account fingerprint:
126 $ sudo -Hu nginx -g nginx acme.sh --register-account
129 You need to add the following to your nginx configuration for the server
133 location ~ ^/\.well-known/acme-challenge/([-_a-zA-Z0-9]+)$ {
134 default_type text/plain;
135 return 200 "$1.6fXAG9VyG0IahirPEU2ZerUtItW2DHzDzD9wZaEKpqd";
139 Replace the string after after `$1.` with your fingerprint.
144 # /etc/rc.d/nginx start
147 It should now be possible to issue a cert (replace `example.com`
148 with your domain name):
151 $ sudo -Hu nginx -g nginx acme.sh --issue -d example.com --stateless
154 Let's add auto-renewal to `/etc/daily.local`
155 (replace `example.com` with your domain):
158 /usr/pkg/bin/sudo -Hu nginx -g nginx \
159 /usr/pkg/sbin/acme.sh -r \
161 --cert-file /etc/nginx/tls/cert \
162 --key-file /etc/nginx/tls/key \
163 --ca-file /etc/nginx/tls/ca \
164 --fullchain-file /etc/nginx/tls/fullchain \
168 ## Creating a startup script for Pleroma
170 Copy the startup script to the correct location and make sure it's executable:
173 # cp /home/pleroma/pleroma/installation/netbsd/rc.d/pleroma /etc/rc.d/pleroma
174 # chmod +x /etc/rc.d/pleroma
177 Add the following to `/etc/rc.conf`:
181 pleroma_home="/home/pleroma"
182 pleroma_user="pleroma"
185 Run `# /etc/rc.d/pleroma start` to start Pleroma.
189 Restart nginx with `# /etc/rc.d/nginx restart` and you should be up and running.
191 If you need further help, contact niaa on freenode.
193 Make sure your time is in sync, or other instances will receive your posts with
194 incorrect timestamps. You should have ntpd running.
196 ## Instances running NetBSD
198 * <https://catgirl.science>