Skip to main content

Self Host

About 1 min...

If you don't want to deploy the server on Vercel, you can also choose to deploy on your own server.

Docker Deploy

docker run -d \
  -e LEAN_ID=xxx \
  -e LEAN_KEY=xxx \
  -e LEAN_MASTER_KEY=xxx \
  -p 8360:8360 \

LEAN_ID LEAN_KEY and LEAN_MASTER_KEY correspond to the App Id, App Key and Master Key obtained in the background respectively. If you are not a LeanCloud International version user, you need to bind the registered domain name in the background and configure LEAN_SERVER.

How to build image?

git clone
cd waline
docker build -t lizheming/waline -f packages/server/Dockerfile .

via docker stack deployopen in new window or docker-composeopen in new window

The SQLite is used here as an example. For SQLite and supported database services, please refer to Multi-database service support.

Example docker-compose.yml for waline:

# docker-compose.yml
version: '3'

    container_name: waline
    image: lizheming/waline:latest
    restart: always
      - ${PWD}/data:/app/data
      TZ: 'Asia/Shanghai'
      SQLITE_PATH: '/app/data'
      JWT_TOKEN: 'Your token'
      SITE_NAME: 'Your site name'
      SITE_URL: ''
      AUTHOR_EMAIL: ''

It's easy to run without using docker deployment, after setting environment variables, just run the vanilla.js file in the module after installing.

npm install @waline/vercel
node node_modules/@waline/vercel/vanilla.js

Nginx config

If you don't want to use port in server url, you can use Nginx proxy pass to 80 and 443. Refer to the following configuration:

  listen 80;
  listen 443 ssl http2;
  root /www/wwwroot/;
  if ($server_port !~ 443){
    rewrite ^(/.*)$ https://$host$1 permanent;

  # SSL setting
  ssl_certificate fullchain.pem;
  ssl_certificate_key privkey.pem;
  ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:10m;
  ssl_session_timeout 10m;
  add_header Strict-Transport-Security "max-age=31536000";

  # proxy to 8360
  location / {
    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;
    proxy_set_header REMOTE-HOST $remote_addr;
    add_header X-Cache $upstream_cache_status;
    # cache
    add_header Cache-Control no-cache;
    expires 12h;
TIPS: The comment area is only for demo. If you have any questions, please go to Github Discussion to ask.
What do you think?
  • 0
  • 0
  • 0
  • 0
  • 0
  • 0
  • Latest
  • Oldest
  • Hottest
Powered by Waline v3.0.0-alpha.4