How to Install Misskey with Docker as a Twitter Alternative
Discover how to easily install Misskey using Docker and explore a fresh, decentralized alternative to Twitter.
Docker
Enable running Docker without sudo. Replace “username” with your own:
sudo usermod -aG docker username
Download Misskey:
mkdir ~/docker
cd ~/docker
git clone -b master https://github.com/misskey-dev/misskey.git misskey
cd misskey
Create Misskey configuration files:
cp .config/docker_example.yml .config/default.yml
cp .config/docker_example.env .config/docker.env
cp ./compose_example.yml ./docker-compose.yml
(Retrieved from Misskey documentation on October 11, 2024)
Open docker-compose.yml:
nano docker-compose.yml
Change ports to 4004:4004
:
services:
web:
ports:
- "4004:4004"
Open docker.env:
nano .config/docker.env
Set database username and password. Password must be between 8 and 128 characters long and can’t contain /, ”, or @:
db:
POSTGRES_PASSWORD=password
POSTGRES_USER=misskey-admin
Open default.yml:
nano .config/default.yml
Copy database username and password from docker.env:
db:
user: misskey-admin
pass: password
Build Docker image:
docker compose build
docker compose run --rm web pnpm run init
Start Docker:
docker compose up -d
Reverse Proxy
Install Caddy:
sudo apt install caddy
Open Caddyfile:
sudo nano /etc/caddy/Caddyfile
Update Caddyfile:
example.com {
route /social* {
uri strip_prefix /social
redir https://social.{host}{uri}
}
}
social.example.com {
reverse_proxy localhost:4004
# Uncomment the line below to set your profile as the homepage.
# redir / /@username
}
Restart Caddy:
sudo systemctl restart caddy
Go to Misskey at https://social.example.com or at https://example.com/social if you prefer using a subpath.
Create your account. Your profile link is https://social.example.com/@username and https://example.com/social/@username.
In Control Panel > Moderation, uncheck Enable new user registration.
Folder Permission
Enable uploading pictures and videos:
sudo chown -hR 991:991 ./files
(Retrieved from Misskey GitHub on October 11, 2024)