Nguyen Quang Thao

Aug 11, 2026 · 1 min read

Cài đặt tunnel server để mở port ra ngoài

Hehe nay ngồi trên công ty xong có task cần forward port ra ngoài để test mà đang nghĩ tới ngrok, serveo.net, localhost.run nhưng mình thích tự host server riêng cơ hehehe

Bắt tay vào làm thôi, đầu tiên tạo 1 thư mục

mkdir -p ~/sish/{ssl,keys}
cd ~/sish
vim docker-compose.yml
services:
  sish:
    image: antoniomika/sish:latest
    container_name: sish
    restart: unless-stopped
    ports:
      - "2222:2222"   # sish's SSH tunnel port (NOT your system SSH)
      - "80:80"       # HTTP tunnels
      - "443:443"     # HTTPS tunnels
    volumes:
      - ./keys:/keys
      - ./pubkeys:/pubkeys
      - ./ssl:/ssl
    command: >
      --ssh-address=:2222
      --http-address=:80
      --https-address=:443
      --https=true
      --https-certificate-directory=/ssl
      --authentication=false
      --bind-random-subdomains=false
      --bind-random-ports=false
      --domain=thaonq.id.vn
      --idle-connection=true
      --idle-connection-timeout=24h

Xong rồi chạy docker compose up thôi

Còn nhớ config Cloudflare tunnel hôm trước chứ, chưa thì mò lại bài viết cũ nhé. Mở file config lên xong thêm 2 dòng này

vim /etc/cloudflared/config.yml
- hostname: "*.thaonq.id.vn"
  service: http://localhost:80
  originRequest:
    noHappyEyeballs: true
    keepAliveTimeout: 90s
    noTLSVerify: true
    disableChunkedEncoding: true

Xong chạy lệnh route DNS cho cloudflare là xong

cloudflared tunnel route dns <tunnel-name-or-id> "*.thaonq.id.vn"

Bây giờ forward port bằng lệnh này là được nhé

ssh -p 2222 -R 80:localhost:5173 -R 80:localhost:8000 100.66.175.23
Blog post image

Chúc may mắn!!!