Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
services:lemmy [2025/01/27 19:32] – willy | services:lemmy [2025/02/04 11:04] (current) – willy | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Lemmy ====== | ====== Lemmy ====== | ||
- | [[https:// | + | [[https:// |
- | Please note that Lemmy requires a dedicated subdomain | + | Luckly, it's pretty easy to self-host and it seems not to require many resources, so far. |
+ | |||
+ | **Note: | ||
==== Installation ==== | ==== Installation ==== | ||
- | Following | + | I suggest you follow |
- | Create | + | First of all, create |
< | < | ||
useradd -d / | useradd -d / | ||
Line 16: | Line 18: | ||
mkdir / | mkdir / | ||
chown lemmy:lemmy /data/lemmy -R | chown lemmy:lemmy /data/lemmy -R | ||
- | chmod o+w / | + | chmod o+w / |
</ | </ | ||
- | There are four files that you need to edit, download the raw ones: | + | The **/ |
+ | <code bash> | ||
+ | cd / | ||
+ | ls -l pictrs | ||
+ | # Now grab the UID and GID of the files inside the pictrs folder and use them for the following command: | ||
+ | chown UID:GIR -R pictrs | ||
+ | chmod o-w pictrs -R | ||
+ | </ | ||
+ | |||
+ | There are five files that you need to edit, download the raw ones: | ||
<code bash> | <code bash> | ||
su - lemmy | su - lemmy | ||
Line 28: | Line 39: | ||
wget https:// | wget https:// | ||
</ | </ | ||
+ | Please pay attention that you moved the files to **/ | ||
+ | |||
+ | Here are some notes on editing them, start with the guide linked above, then follow my notes. | ||
+ | |||
+ | === lemmy.hjson === | ||
+ | |||
+ | This contains critical setup for your Lemmy instance: | ||
+ | <file - lemmy.hjson> | ||
+ | { | ||
+ | database: { | ||
+ | host: postgres | ||
+ | password: "<< | ||
+ | } | ||
+ | hostname: " | ||
+ | pictrs: { | ||
+ | url: " | ||
+ | api_key: "<< | ||
+ | } | ||
+ | email: { | ||
+ | smtp_server: | ||
+ | smtp_from_address: | ||
+ | tls_type: " | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | You could edit the email section and enable your own email server, if you have one, to get a better chance of your lemmy emails to reach users. | ||
+ | |||
+ | === nginx_internal.conf === | ||
+ | |||
+ | This is the Lemmy internal NGINX web server setup. You need this even if you will be slapping an additional NGINX reverse proxy in front of it. | ||
+ | |||
+ | There is only one line to edit here, which is the internal resolver address: | ||
+ | < | ||
+ | resolver | ||
+ | </ | ||
+ | |||
+ | This is important, because this internal NGINX will need to resolve the other containers by name, and this can be achieved by enabling Podman internal name resolutions for the // | ||
+ | < | ||
+ | networks: | ||
+ | lemmy-net: | ||
+ | dns_enabled: | ||
+ | </ | ||
+ | |||
+ | Differently from docker, in podman the internal resolver address is **10.89.0.1**. | ||
+ | |||
+ | === proxy_params === | ||
+ | |||
+ | This file doesn' | ||
+ | |||
+ | |||
+ | === customPostgresql.conf === | ||
+ | |||
+ | This file contains specific PostgreSQL setup to fine-tune the database to your hardware capabilties. Go to [[https:// | ||
+ | |||
+ | Yes, in other words, you can discard the content of the original downloaded file and replace it with the one generated by the page linked in this paragraph. | ||
- | then edit the first three files following the guide linked above. | ||
- | Please pay attention that you moved the files to **/ | ||
- | For the **nginx_internal.conf** you need to specify **10.89.0.1** as // | + | === docker-compose.yml === |
- | I will post here my docker-compose.yml since it' | + | This is the most critical file. The following is derived from the one linked above, but i have done a few podman specific editings, noted below: |
<file - docker-compose.yml> | <file - docker-compose.yml> | ||
x-logging: & | x-logging: & | ||
Line 46: | Line 111: | ||
image: nginx: | image: nginx: | ||
ports: | ports: | ||
- | | + | - " |
- | # number to a different port, eg using port 80 if you don't need a reverse proxy. | + | |
- | | + | |
volumes: | volumes: | ||
- / | - / | ||
Line 86: | Line 149: | ||
pictrs: | pictrs: | ||
image: asonix/ | image: asonix/ | ||
- | # this needs to match the pictrs url in lemmy.hjson | ||
hostname: pictrs | hostname: pictrs | ||
- | # we can set options to pictrs like this, here we set max. image size and forced format for conversion | ||
- | # entrypoint: /sbin/tini -- / | ||
environment: | environment: | ||
- PICTRS_OPENTELEMETRY_URL=http:// | - PICTRS_OPENTELEMETRY_URL=http:// | ||
Line 98: | Line 158: | ||
- PICTRS__MEDIA__ANIMATION__MAX_HEIGHT=256 | - PICTRS__MEDIA__ANIMATION__MAX_HEIGHT=256 | ||
- PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT=400 | - PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT=400 | ||
- | user: 991:991 | + | user: 991: |
volumes: | volumes: | ||
- | - / | + | - / |
restart: always | restart: always | ||
logging: *default-logging | logging: *default-logging | ||
Line 111: | Line 171: | ||
environment: | environment: | ||
- POSTGRES_USER=lemmy | - POSTGRES_USER=lemmy | ||
- | - POSTGRES_PASSWORD=<< | + | - POSTGRES_PASSWORD=<< |
- POSTGRES_DB=lemmy | - POSTGRES_DB=lemmy | ||
shm_size: 1g | shm_size: 1g | ||
Line 125: | Line 185: | ||
image: mwader/ | image: mwader/ | ||
environment: | environment: | ||
- | - POSTFIX_myhostname=" | + | - POSTFIX_myhostname=" |
restart: " | restart: " | ||
logging: *default-logging | logging: *default-logging | ||
Line 133: | Line 193: | ||
networks: | networks: | ||
lemmy-net: | lemmy-net: | ||
- | dns_enabled: | + | dns_enabled: |
</ | </ | ||
- | Please note that this compose file is a bit different from the original one. Note the network, which enabled DNS internal name resolver, which is disabled by default in podman but needs to be enabled for the proxy to work. Also note that the //depends// lines have been changed a bit from the docker original example. | ||
+ | Please also note that the //depends// lines have been changed a bit from the docker original example, maybe due to some podman differences. | ||
- | Last, edit the **customPostgresql.conf** with the output generated from [[https:// | + | **Note:** first startup might fail because |
- | Now pull it: | + | Now pull the images: |
<code bash> | <code bash> | ||
podman compose pull | podman compose pull | ||
Line 189: | Line 249: | ||
add_header X-Frame-Options " | add_header X-Frame-Options " | ||
add_header X-XSS-Protection "1; mode=block"; | add_header X-XSS-Protection "1; mode=block"; | ||
+ | |||
+ | access_log / | ||
+ | error_log / | ||
location / { | location / { | ||
Line 224: | Line 287: | ||
rc-service user-containers.lemmy start | rc-service user-containers.lemmy start | ||
</ | </ | ||
+ | |||
+ | |||
+ | ==== Usage Notes ==== | ||
+ | |||
+ | A few notes and hints i learned after setting everything up and running. | ||
+ | |||
+ | * Federation takes hours. Expect at least half day / one day for your new instance to propagate the fediverse and start being picked up by other lemmy instances. At least a few hours. Manually forcing specified instances by searching for communities on them will speed this up a bit, but not too much. | ||
+ | |||
+ | * Registering new users will just popup a notification in your admin panel, you will need to go there and accept them. At first i was expecting an email in my inbox (a real email), but i doesnt happen. At the same time, i strongly suggest you don't allow open registrations for legal issues and such. | ||
+ | |||
+ | * You might want to head to [[https:// | ||
+ | |||