4.5 KiB
4.5 KiB
Complete Lemmy Setup Guide for Unraid
Prerequisites
- Create the following directory structure on your Unraid server:
/mnt/user/appdata/lemmy/
├── config/ # Lemmy configuration
├── postgres/ # PostgreSQL data
└── pictrs/ # Image storage
Step 1: PostgreSQL Setup
-
Install the Lemmy-Postgres template
-
Configure these essential variables:
- POSTGRES_USER:
lemmy
- POSTGRES_PASSWORD:
[choose a secure password]
- POSTGRES_DB:
lemmy
- Data Path:
/mnt/user/appdata/lemmy/postgres
- Port:
5433
(or different if in use)
- POSTGRES_USER:
-
Start the container and verify it's running by checking logs
Step 2: Pict-rs Setup
- Install the Pict-rs template
- Configure:
- API Key:
[generate a secure key]
- Media Path:
/mnt/user/appdata/lemmy/pictrs
- API Key:
- Note down the API key for later use in Lemmy configuration
- Start the container
Step 3: Lemmy Server Setup
- Install the Lemmy-Server template
- Create
/mnt/user/appdata/lemmy/config/lemmy.hjson
with this content:
{
hostname: "your_domain.com"
port: 8536
tls_enabled: false # Set to true if using HTTPS
# Database settings
database: {
host: "lemmy-postgres"
port: 5432
user: "lemmy"
password: "[your postgres password]"
database: "lemmy"
pool_size: 5
}
# Picture service
pictrs: {
url: "http://pict-rs:8080/"
api_key: "[your pictrs api key]"
}
# Rate limits
rate_limit: {
message: 180
message_per_second: 60
post: 50
post_per_second: 600
register: 20
register_per_second: 3600
image_upload: 6
image_upload_per_second: 3600
}
}
- Configure:
- Config Path:
/mnt/user/appdata/lemmy/config
- WebSocket Port:
8536
- Config Path:
- Start the container
Step 4: Lemmy UI Setup
- Install the Lemmy-UI template
- Configure:
- WebUI Port:
1236
- Environment Variables:
- LEMMY_UI_LEMMY_INTERNAL_HOST:
lemmy-server:8536
- LEMMY_UI_LEMMY_EXTERNAL_HOST:
your_domain.com
(orlocalhost:1236
for local testing) - LEMMY_UI_HTTPS:
false
(set to true if using HTTPS)
- LEMMY_UI_LEMMY_INTERNAL_HOST:
- WebUI Port:
- Start the container
Step 5: Reverse Proxy (Optional but Recommended)
If you're using SWAG or another reverse proxy, add this configuration:
location / {
proxy_pass http://lemmy-ui:1236;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /api {
proxy_pass http://lemmy-server:8536;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /pictrs {
proxy_pass http://pict-rs:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 20M;
}
Verification Steps
- Check all container logs for errors
- Access the UI at
http://your_server_ip:1236
- Create an admin account (first account becomes admin)
- Test image upload functionality
- Verify WebSocket connection (realtime updates should work)
Troubleshooting
-
Connection Issues:
- Verify all containers are running
- Check container logs for errors
- Ensure ports are not conflicting
- Verify network connectivity between containers
-
Database Issues:
- Check PostgreSQL logs
- Verify database credentials in lemmy.hjson
- Ensure database is properly initialized
-
Image Upload Issues:
- Verify Pict-rs API key matches in configuration
- Check Pict-rs logs
- Verify storage permissions
-
UI Issues:
- Clear browser cache
- Verify LEMMY_UI_LEMMY_INTERNAL_HOST setting
- Check browser console for errors
Backup Considerations
Regular backup of these directories is recommended:
/mnt/user/appdata/lemmy/postgres/
(Database)/mnt/user/appdata/lemmy/config/
(Configuration)/mnt/user/appdata/lemmy/pictrs/
(Uploaded media)
Security Recommendations
- Use strong, unique passwords for:
- PostgreSQL database
- Pict-rs API key
- Admin account
- Enable HTTPS if exposed to the internet
- Regularly update all containers
- Monitor logs for suspicious activity