banner
 Sayyiku

Sayyiku

Chaos is a ladder
telegram
twitter

Docker Misskey

image

The entire setup process initially referred to the official website, which was found to be a bit complicated. Then I came across the experience sharing of the two friends below, which was very helpful. Thank you for your contributions!

Setup sharing: Minimal Deployment of Misskey Using Docker

This tutorial is basically ~referenced~ copied from the above setup tutorial XD

Usage sharing: Fediverse is More Than Mastodon—Introduction to Misskey

1. Introduction#

Misskey is a decentralized social network service founded by Japanese developer しゅいろ (syuilo), with its official instance at misskey.io. Like Mastodon, Misskey uses the ActivityPub protocol, allowing it to interoperate with the federated universe Fediverse.

In simple terms, it is a decentralized version of Weibo!

What we create is an instance, and different instances can interact with each other.

image

Official instance address: https://misskey.io/ (If you don't want to set it up yourself, you can directly join the official instance, but it seems to be in Japanese.)

Official website: https://misskey-hub.net/en/

GitHub address: https://github.com/misskey-dev/misskey (3k stars)

Instance list: https://join.misskey.page/zh-CN/instances (If you don't want to set it up yourself, you can also join an instance to use)

2. Project Showcase#

image

3. Setup Environment#

  • System: Debian 11

  • Install Docker, Docker-compose

  • Service: Unesty Spring Promotion High Configuration German VDS

4. Start Setup#

sudo -i

mkdir -p /root/data/docker_data/misskey

cd /root/data/docker_data/misskey

docker-compose.yml Content#

# Misskey minimal deploy config
version: "3"

services:
  web:
    restart: always # Automatically restart. Please note that if you are not confident in your configuration, do not enable this option to avoid excessive resource consumption due to repeated crashes!
    image: misskey/misskey:latest # Using the official image to avoid resource shortages during local builds
    container_name: misskey_web # Container name for easy management, you can modify it to something you find suitable
    links:
      - db
      - redis
    ports:
      - "3001:3001"
    networks:
      - internal_network
      - external_network
    volumes:
      - ./config:/misskey/.config:ro # Used to map configuration files, please decide the folder name based on your actual configuration, set it to read-only;
      - ./files:/misskey/files # Files uploaded by users to the local system. If you connect external storage (like Wasabi or AWS S3) from the beginning, you can ignore this configuration

  redis:
    restart: always
    image: redis:latest
    container_name: misskey_redis
    networks:
      - internal_network
    volumes:
      - ./redis:/data # Mapping of the Redis database data folder, created by default in the ./redis folder

  db:
    restart: always
    image: postgres:12.2-alpine
    container_name: misskey_db
    networks:
      - internal_network
    env_file:
      - ./config/docker.env # Requires Docker environment variables set in the configuration file
    volumes:
      - ./db:/var/lib/postgresql/data # Mapping of the main database data folder, created by default in the ./db folder

networks:
  internal_network: # Internal network
    internal: true
  external_network: # External network
mkdir config
cd config
vim default.yml

default.yml Content#

#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# Misskey configuration
#━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

#   ┌─────┐
#───┘ URL └─────────────────────────────────────────────────────

# Final accessible URL seen by a user.
url:        # Note to change to the URL you want for reverse proxy

# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE
# URL SETTINGS AFTER THAT!

#   ┌───────────────────────┐
#───┘ Port and TLS settings └───────────────────────────────────

#
# Misskey requires a reverse proxy to support HTTPS connections.
#
#                 +----- https://example.tld/ ------------+
#   +------+      |+-------------+      +----------------+|
#   | User | ---> || Proxy (443) | ---> | Misskey (3000) ||
#   +------+      |+-------------+      +----------------+|
#                 +---------------------------------------+
#
#   You need to set up a reverse proxy. (e.g. nginx)
#   An encrypted connection with HTTPS is highly recommended
#   because tokens may be transferred in GET requests.

# The port that your Misskey server should listen on.
port: 3001

#   ┌──────────────────────────┐
#───┘ PostgreSQL configuration └────────────────────────────────

db:
  host: db
  port: 5432

  # Database name
  db: misskey

  # Auth
  user: example-misskey-user
  pass: example-misskey-pass

  # Whether disable Caching queries
  #disableCache: true

  # Extra Connection options
  #extra:
  #  ssl: true

#   ┌─────────────────────┐
#───┘ Redis configuration └─────────────────────────────────────

redis:
  host: redis
  port: 6379
  #family: 0  # 0=Both, 4=IPv4, 6=IPv6
  #pass: example-pass
  #prefix: example-prefix
  #db: 1

#   ┌─────────────────────────────┐
#───┘ Elasticsearch configuration └─────────────────────────────

#elasticsearch:
#  host: localhost
#  port: 9200
#  ssl: false
#  user: 
#  pass: 

#   ┌───────────────┐
#───┘ ID generation └───────────────────────────────────────────

# You can select the ID generation method.
# You don't usually need to change this setting, but you can
# change it according to your preferences.

# Available methods:
# aid ... Short, Millisecond accuracy
# meid ... Similar to ObjectID, Millisecond accuracy
# ulid ... Millisecond accuracy
# objectid ... This is left for backward compatibility

# ONCE YOU HAVE STARTED THE INSTANCE, DO NOT CHANGE THE
# ID SETTINGS AFTER THAT!

id: 'aid'

#   ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

# Whether disable HSTS
#disableHsts: true

# Number of worker processes
#clusterLimit: 1

# Job concurrency per worker
# deliverJobConcurrency: 128
# inboxJobConcurrency: 16

# Job rate limiter
# deliverJobPerSec: 128
# inboxJobPerSec: 16

# Job attempts
# deliverJobMaxAttempts: 12
# inboxJobMaxAttempts: 8

# IP address family used for outgoing request (ipv4, ipv6 or dual)
#outgoingAddressFamily: ipv4

# Syslog option
#syslog:
#  host: localhost
#  port: 514

# Proxy for HTTP/HTTPS
#proxy: http://127.0.0.1:3128

#proxyBypassHosts: [
#  'example.com',
#  '192.0.2.8'
#]

# Proxy for SMTP/SMTPS
#proxySmtp: http://127.0.0.1:3128   # use HTTP/1.1 CONNECT
#proxySmtp: socks4://127.0.0.1:1080 # use SOCKS4
#proxySmtp: socks5://127.0.0.1:1080 # use SOCKS5

# Media Proxy
#mediaProxy: https://example.com/proxy

# Proxy remote files (default: false)
#proxyRemoteFiles: true

# Sign to ActivityPub GET request (default: false)
#signToActivityPubGet: true

#allowedPrivateNetworks: [
#  '127.0.0.1/32'
#]

# Upload or download file size limits (bytes)
#maxFileSize: 262144000
docker.env Content
# db settings
POSTGRES_PASSWORD=example-misskey-pass
POSTGRES_USER=example-misskey-user
POSTGRES_DB=misskey
Start
cd ..    # Go to the folder where the docker-compose file is located
docker-compose run --rm web yarn run init   # Initialize the database
docker-compose up -d 

5. User Guide#

5.1 Installation and Configuration#

For detailed usage reference: Fediverse is More Than Mastodon—Introduction to Misskey

6. BUG Resolution#

Troubleshooting
After the initial installation of the server, there was an Internal Server Error when uploading images. By checking the logs with docker logs, I found:

image

The reason was insufficient permissions, so I entered the Misskey installation directory to modify the permissions.

sudo chown -R 991:991 files

References#

Setup reference: Minimal Deployment of Misskey Using Docker

Usage reference: Fediverse is More Than Mastodon—Introduction to Misskey

Official instance address: https://misskey.io/

Official website: https://misskey-hub.net/en/

GitHub address: https://github.com/misskey-dev/misskey (3k stars)

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.