-
Notifications
You must be signed in to change notification settings - Fork 66
en Deployment
Overview · Features · Tech Stack · Quick Start · Deployment · Project Structure · Architecture · Widgets · API · Database · Settings · Security · Configuration · Roadmap · License
Click the button to connect your GitHub repo and deploy to Cloudflare Workers. The platform auto-detects npm run build and npm run deploy as the build and deploy commands.
When a new release is available, click the button above again, or trigger a redeploy from Workers Builds in your forked template repo.
When configuring the D1 database, select your existing ternssh database—do not create a new one. This keeps your servers, credentials, dashboards, and other data. npm run deploy runs database migrations automatically.
If Workers Builds is already set up, you usually only need to push the new version or manually trigger a build; you do not need to re-bind the database.
One-click deploy forks the template repository into your GitHub account and connects Workers Builds to that fork. Each new release updates the template repo’s main branch; merge those upstream changes into your fork and push to trigger an automatic Cloudflare build and deploy.
Prerequisites: You completed one-click deploy and Workers Builds is linked to your fork (Cloudflare Dashboard → Workers & Pages → your Worker → Settings → Builds).
- Open your fork (e.g.
https://github.com/<your-username>/ternssh-cloudflare-workers-template). - If your fork is behind upstream, click Sync fork → Update branch to merge upstream
main. - After the sync, Workers Builds detects the new commit on
mainand runsnpm run buildandnpm run deploy. - Check build logs under Builds in the Cloudflare Dashboard to confirm success.
If Sync fork is not shown, your fork is already up to date or upstream has not published a new release yet. Compare the VERSION file at the repo root with upstream.
Add the upstream remote once:
git clone https://github.com/<your-username>/ternssh-cloudflare-workers-template.git
cd ternssh-cloudflare-workers-template
git remote add upstream https://github.com/haradakashiwa/ternssh-cloudflare-workers-template.gitTo upgrade:
git fetch upstream
git checkout main
git merge upstream/main
git push origin mainAfter git push, Workers Builds deploys automatically—you do not need to re-bind D1 or environment variables in the Dashboard.
- The template repo is generated by CI—do not edit your fork by hand. If you changed files, merges may conflict; prefer resolving in favor of
upstream/main. -
wrangler.production.jsoncis gitignored and is not overwritten by merges. At build time,scripts/generate-production-config.mjsgenerates it from your account’s D1 database or the Workers Builds env varD1_DATABASE_ID. -
npm run deployruns D1 migrations automatically; servers, credentials, and other data stay in your existing database. - If a push does not trigger a build, use Retry deployment under Dashboard → Builds, or click the Deploy button at the top of this page again (select your existing Worker—do not create a new one).
For production auth (Cloudflare Access / Basic Auth), see Security · Authentication.
The Docker image runs the full app via Wrangler local mode—good for private networks or a quick trial. Official image: ghcr.io/haradakashiwa/ternssh.
docker run (pre-built image):
docker run -d \
--name ternssh \
-p 8787:8787 \
-v ternssh-data:/app/.wrangler \
--restart unless-stopped \
ghcr.io/haradakashiwa/ternssh:latestdocker compose:
docker compose -f docker-compose.ghcr.yml up -dPin a version: TERNSSH_TAG=1.0.0 docker compose -f docker-compose.ghcr.yml up -d
Custom port: PORT=8080 docker compose -f docker-compose.ghcr.yml up -d
Build from source: docker compose up -d --build
Open http://localhost:8787 (or your mapped port). Data persists in the /app/.wrangler volume.
Basic Auth setup: Security · HTTP Basic Auth (database credentials).