---
title: "Deploy tusd"
description: "tusd 2.10: resumable file uploads over the tus protocol, token-protected."
category: "Storage"
url: https://railway.com/deploy/tusd
---

# Deploy tusd

tusd 2.10: resumable file uploads over the tus protocol, token-protected.

**[Deploy tusd on Railway](https://railway.com/template/tusd)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/tusd/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Storage

## Template content

### tusd https://github.com/tus.png

- **Image:** tusproject/tusd:v2.10.1
- **Start command:** `sh -c 'mkdir -p /tmp/hooks /srv/tusd-data/data; chown tusd:tusd /srv/tusd-data /srv/tusd-data/data; printf "%s\n" "#!/bin/sh" "jq -e --arg t \"Bearer \$TUSD_UPLOAD_TOKEN\" \".Event.HTTPRequest.Header.Authorization[0] == \\\$t\" >/dev/null && exit 0" "jq -nc \"{RejectUpload:true,HTTPResponse:{StatusCode:401}}\"" > /tmp/hooks/pre-create; chmod 755 /tmp/hooks/pre-create; if [ -n "${TUSD_HOOKS_HTTP:-}" ]; then set -- -hooks-http "$TUSD_HOOKS_HTTP" -hooks-http-forward-headers Authorization,Cookie; else set -- -hooks-dir /tmp/hooks; fi; exec su -s /bin/sh -c "exec \"\$0\" \"\$@\"" -- tusd /usr/local/share/docker-entrypoint.sh -host "" -port 8080 -base-path /files/ -behind-proxy -upload-dir /srv/tusd-data/data -hooks-enabled-events pre-create -max-size "${TUSD_MAX_SIZE:-0}" "$@"'`
- **Health check:** /metrics
- **Public domain:** Yes

## Documentation

# Deploy and Host tusd on Railway

tusd is the official reference server for tus, the open protocol for resumable file uploads. Clients upload in chunks and can resume after a dropped connection instead of starting over. Client libraries exist for browsers, iOS, Android, Node.js, Python and more, including Uppy, a popular upload widget.

## About Hosting tusd

This template runs the official `tusproject/tusd:v2.10.1` image with its upload endpoint at `/files/` on a public HTTPS domain. Finished and partial uploads are stored on a Railway volume. By default, a pre-create hook accepts new uploads only when the request carries `Authorization: Bearer `. To decide per user instead, set `TUSD_HOOKS_HTTP` to an endpoint in your own backend, and tusd will ask it before accepting each upload. Uploads are capped at 1 GiB each by default. A finished upload can be downloaded from its unguessable URL. tusd runs as an unprivileged user.

## Common Use Cases

- Large file uploads from web and mobile apps that must survive flaky connections
- An Uppy upload backend that your app authorizes with a token or hook
- Collecting media or datasets before your backend processes them

## Dependencies for tusd Hosting

- `tusproject/tusd:v2.10.1` (official image)
- A Railway volume at `/srv/tusd-data` (Hobby 5 GB, Pro 50 GB by default)

### Deployment Dependencies

- [tusd documentation](https://tus.github.io/tusd/)
- [tusd 2.10.1 release](https://github.com/tus/tusd/releases/tag/v2.10.1)
- [tus client implementations](https://tus.io/implementations)

### Implementation Details

| Service | Source | Networking | Storage |
| --- | --- | --- | --- |
| tusd | `tusproject/tusd:v2.10.1` | public HTTPS, endpoint `/files/` | volume at `/srv/tusd-data` |

| Variable | Default | Purpose |
| --- | --- | --- |
| `TUSD_UPLOAD_TOKEN` | generated | Bearer token the built-in hook requires for new uploads |
| `TUSD_HOOKS_HTTP` | empty | Your backend's hook URL; when set, it replaces the token check |
| `TUSD_MAX_SIZE` | `1073741824` | Largest upload in bytes |
| `TUSD_ENDPOINT` | `https:///files/` | Endpoint for your clients |

Uppy example:

```js
uppy.use(Tus, { endpoint: TUSD_ENDPOINT, headers: { Authorization: `Bearer ${token}` } })
```

Notes:

- With `TUSD_HOOKS_HTTP`, tusd forwards the `Authorization` and `Cookie` headers to your hook, so it can check the user's session.
- A browser can only use the shared token if it is sent to the browser. For public apps, prefer the HTTP hook or short-lived tokens issued by your backend.
- `/metrics` (Prometheus) is public and used as the health check.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the tus project or Transloadit.

## Why Deploy tusd on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying tusd on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/tusd
