I’ve self hosted a lot of things on my own network without issue for a long time. However, I’m having trouble grasping how a few things work with lemmy as it uses a series of docker containers and some configuration files on the host. I guess I don’t really understand where things like encryption certs are stored and how I could change that if I wanted to or how to get into a database and retrieve user info or even reset the admin password if that got lost somehow. I run daily automatic backups, so it shouldn’t be a big issue if something goes sideways, but I’d rather be able to fix it rather than having to reset.
Your lemmy instance should have an endpoint for prometheus metrics;
https://domain.com/metrics
.Install prometheus (in a docker container) and setup lemmy as a target. From within docker, create a new network called
prometheus
and add your prometheus container and lemmy to it. Then using the data that prometheus pulls, you can setup a nice looking dashboard in Grafana like this: https://i.xno.dev/4nLNK.pngThe dashboard above is for my private DNS DoH stub resolver. You’ll have to make the dashboard yourself because there are no public dashboards for lemmy.
This option is preferable because it all works with docker: https://i.xno.dev/cWjtR.png
And this is what the prometheus config should look like;
[xanza@dev prometheus]$ cat *.yml #prometheus.yml global: scrape_interval: 15s evaluation_interval: 15s scrape_configs: - job_name: 'docker' file_sd_configs: - files: - targets.yml #targets.yml - targets: ['blocky:4000'] labels: job: blocky __metrics_path__: /metrics
This will show all the individual steps happening to configure an instance without docker: https://github.com/LemmyNet/lemmy-ansible
This is the guide I used, it’s pretty automatic with ansible.