Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
FREEDOM251

Freedom251 › Blog › Docker

How to Self-Host Onetime Secret on a VPS (Docker, Redis and HTTPS)

By Freedom251 Team · · 10 min read

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To self-host Onetime Secret, run its Docker image on a Linux VPS, connect it to a private Redis or Valkey service, preserve one high-entropy SECRET, and put the application behind an HTTPS reverse proxy. The documented baseline is at least 2 CPU cores, 2 GB RAM and 10 GB disk. Simple mode needs Redis or Valkey; full mode adds PostgreSQL and RabbitMQ for account features such as MFA, SSO, WebAuthn and organizations.

What you are building

Self-hosting gives you control over the server, network, storage and operational policies for a private Onetime Secret instance. The official documentation describes Docker as the most reliable and portable deployment method (installation guide). The current stable release identified in the documentation is v0.26 (documentation checked October 18, 2026).

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical production layout has four parts:

  • A Linux VPS running Docker Engine and Compose.
  • An Onetime Secret container attached to a private Docker network.
  • A Redis or Valkey container on that same network, with no public port.
  • A reverse proxy that terminates TLS and forwards HTTPS requests to the application’s port 3000.

Point a DNS A or AAAA record at the VPS, set Onetime Secret’s HOST to the public hostname, and set SSL=true when the proxy provides HTTPS. The generated links will then use the secure scheme.

Choose simple or full mode before installing

Mode Services Capabilities Operational trade-off
Simple Onetime Secret plus Redis or Valkey Core one-time-secret creation, retrieval and expiration Fewest moving parts and the shortest production path
Full Onetime Secret, Redis or Valkey, PostgreSQL and RabbitMQ Account-oriented features including MFA, SSO, WebAuthn and organizations More configuration, upgrades, monitoring and recovery work

Use simple mode unless you specifically need account controls. Full mode is justified when administrators need identities, multifactor authentication, enterprise sign-on or organization management; adding its services without using those capabilities increases the failure and maintenance surface.

#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter | 4Pack Type C Female to A Male Cable Converter for Apple Duo 17 16 15 14 Plus,iWatch Watch 12 11 10,iPad 9 8 Air,Airpods 5 4
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

Read the feature and dependency overview before selecting full mode: Onetime Secret self-hosting documentation.

VPS requirements and architecture decisions

Minimum documented baseline

Resource Recommended baseline How to interpret it
CPU 2 or more cores Provides headroom for the web process, Redis operations, TLS proxying and maintenance tasks.
Memory 2 GB or more RAM The self-hosting overview’s baseline; the getting-started guide separately notes 1 GB or more for optimal performance.
Disk 10 GB or more Covers the operating system, container layers, logs and any configured data persistence. It is not a promise of unlimited secret retention.
Operating system Linux with Docker Engine and Compose Install Docker from your distribution’s official repository or the vendor’s official installation channel.
Network DNS plus inbound HTTPS and restricted SSH Keep Redis/Valkey and the application container port private whenever possible.

When comparing VPS plans, evaluate CPU and RAM headroom, disk type, encrypted-backup options, firewall controls, region and latency, IPv6, snapshot/restore support, Docker compatibility, whether Redis/Valkey is colocated or managed, and the recurring total cost. There is no official universal firewall, monitoring schedule or disaster-recovery cadence; choose and document policies that fit your threat model and test restores.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

DNS and firewall plan

  • Create a hostname dedicated to the service and point its A and, if used, AAAA records to the VPS.
  • Allow SSH only as required for administration, preferably from a restricted source range.
  • Allow TCP 80 if your certificate workflow needs an HTTP challenge, and TCP 443 for user traffic.
  • Do not open Redis/Valkey’s port to the Internet. Do not expose port 3000 publicly when the proxy can reach it locally.

Install Docker and prepare the VPS

  1. Provision a Linux VPS meeting the baseline above. Apply the operating system’s security updates and create an administrator account that uses SSH keys rather than password authentication.
  2. Install Docker Engine and the Compose plugin using the operating system’s official repository or Docker’s official instructions. Confirm that both commands work:
docker version
docker compose version
  1. Create a private network for the application and its data service:
docker network create ots-net

Only containers attached to ots-net need to resolve the Redis or Valkey service name. Bind any host-side application port to loopback so the reverse proxy, rather than the public network, is the entry point.

Start Redis or Valkey

The official getting-started material uses a Redis container and explains that storage behavior depends on Redis configuration (getting-started guide). Start the service on the private network, using a tested image tag in production:

docker run -d 
  --name ots-redis 
  --restart unless-stopped 
  --network ots-net 
  redis

For a real deployment, replace the unpinned image reference with the Redis or Valkey tag or digest you have tested and recorded. The service name ots-redis becomes part of the internal connection URL.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter | USB C Dongle with 90W Max Power Delivery, 3×5Gbps USB A Data Ports, for MacBook, Dell, and More (Charger Not Included)
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Decide whether Redis data is persistent

Configuration Benefit Cost or risk Suitable when
Memory-only Minimizes secret residue on disk Secrets disappear if Redis restarts or the VPS loses power Short-lived data and a policy that accepts restart loss
AOF or RDB persistence Improves recovery after a restart Writes secret data to disk and requires volume protection, retention and restore testing Recovery requirements outweigh the additional disk exposure

This is an operational and privacy decision, not a setting with one universally correct value. Document the expiration policy, backup handling and restore procedure that go with your choice. If persistence is enabled, place the data on a protected volume and include it in encrypted backups only when that matches your legal and security requirements.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Generate and protect the root secret

SECRET is the root secret from which derived secrets are generated. Losing it can make existing data and links unusable; changing it can invalidate existing secrets. Generate it before creating production secrets and preserve it in encrypted backups. The image instructions show the same high-entropy approach (Onetime Secret image documentation).

mkdir -p /opt/onetimesecret
cd /opt/onetimesecret
openssl rand -hex 32 > .ots_secret
chmod 600 .ots_secret

Keep this file outside any public web root, restrict the directory to the service administrator, and never commit it to Git. Other authentication secrets may not be recoverable from SECRET; back up every separately configured credential as well.

Configure the application container

Create an environment file without placing the secret in shell history

Set your actual public hostname in a shell variable, then generate the environment file from the protected secret file:

cd /opt/onetimesecret
export OTS_HOST='secrets.example.com'
printf 'SECRET=%snREDIS_URL=redis://ots-redis:6379/0nHOST=%snSSL=truen' "$(cat .ots_secret)" "$OTS_HOST" > .env
chmod 600 .env

secrets.example.com is an example hostname; use the DNS name that points to your VPS. If you use Valkey, set VALKEY_URL according to the image’s configuration reference instead of REDIS_URL. Keep credentials in the environment file or a secret manager rather than embedding them in source files or repeatedly typing them into commands. Review the complete variable reference at Onetime Secret environment variables.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter | 85W Max PD, 2 USB 3.0 & 1 USBC Data Ports, SD/TF Card Reader, for Laptops/Mac and Other Type C Devices (Charger Not Included)
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Run a version-pinned Onetime Secret image

Use the tested release tag rather than latest. With the current documentation identifying v0.26, a simple-mode container can be started as follows:

docker run -d 
  --name onetimesecret 
  --restart unless-stopped 
  --network ots-net 
  --env-file /opt/onetimesecret/.env 
  -p 127.0.0.1:3000:3000 
  onetimesecret/onetimesecret:v0.26

Confirm that the container is running and inspect startup errors:

docker ps
docker logs --tail=200 onetimesecret

If a later release is selected, read its release notes, test it on a non-production instance, and retain the previous image tag until rollback has been validated.

Put HTTPS in front of port 3000

The application should receive traffic through a reverse proxy. The proxy obtains and renews the certificate, redirects HTTP to HTTPS, forwards requests to 127.0.0.1:3000, and can add security headers. Configure the proxy for your chosen web server and certificate authority; the official installation example includes HSTS (installation documentation).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Your proxy configuration needs these behaviors:

  • Serve the configured hostname on HTTPS with a valid certificate.
  • Forward the original host and protocol headers so the application can generate correct links.
  • Proxy to the loopback-bound application port, not to a publicly exposed container port.
  • Redirect HTTP to HTTPS and enable HSTS only after certificate issuance and renewal have been verified.

After DNS and TLS are working, open the public hostname in a private browser window. Check that links begin with https://, cookies are marked secure where applicable, and the certificate renews before enabling a long HSTS lifetime.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray | Data transfer & Fast charging for MacBook, iPhone 17/16/15, iPad, Samsung Galaxy, Apple Watch
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Verify the deployment before inviting users

  1. Create a test secret containing a value that is safe to discard.
  2. Retrieve it once and confirm that a second retrieval is refused or shows the expected consumed state.
  3. Wait for or configure a short expiration and verify that an expired secret cannot be retrieved.
  4. If email is enabled, send a test message and confirm delivery, sender identity and failure handling. Configure SMTP credentials through environment variables rather than source files.
  5. Restart the application and Redis/Valkey containers. Confirm behavior against the persistence policy you selected; memory-only Redis is expected to lose data after a restart.
  6. Inspect logs for connection, hostname, TLS and permission errors, then remove test data.

Security hardening checklist

  • Pin and record tested image tags; do not deploy unreviewed latest updates.
  • Generate SECRET with openssl rand -hex 32, protect it with filesystem permissions, and store an encrypted backup before production use.
  • Back up separately configured authentication secrets and SMTP credentials when they exist.
  • Keep Redis or Valkey on the private Docker network, require authentication where supported, and block its port at both the VPS firewall and cloud firewall.
  • Use HTTPS, secure cookies, SSH keys, automatic operating-system security updates and least-privilege administration.
  • Enable HSTS only after certificate renewal has been tested.
  • For full mode, consider MFA and WebAuthn. A FIDO2/WebAuthn security key is an optional physical administrator control, not a requirement for the base deployment.
  • Monitor disk usage, memory pressure, Redis health, certificate expiry and container restarts.
  • Define retention, backup and restore procedures that do not quietly undermine the privacy promise of one-time secrets.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Simple-mode troubleshooting

The container exits immediately

Run docker logs onetimesecret and check that SECRET, HOST and either REDIS_URL or VALKEY_URL are present. Verify that the environment file is readable by the account launching Docker and has not acquired a trailing formatting error.

Redis connection failures

Confirm both containers are attached to ots-net, that the URL uses the container name rather than localhost, and that Redis is listening on its internal port. From the application container, inspect network membership with docker inspect. Do not solve the problem by opening Redis to the Internet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Links use HTTP or the wrong hostname

Set HOST to the externally reachable DNS name and SSL=true when TLS terminates at the proxy. Check that the proxy forwards the host and protocol headers and that users are reaching the proxy rather than port 3000 directly.

Secrets disappear after a restart

This is expected with memory-only Redis. Choose persistent AOF or RDB storage if restart recovery is required, then protect the volume and test a restore. Do not claim persistence until the complete restart and restore procedure has succeeded.

Existing links stopped working after a change

Compare the current SECRET with the protected backup. Changing or losing the root secret can invalidate existing data and links. Restore the original value only through a controlled maintenance procedure, and investigate whether other authentication secrets also changed.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display | 85W Max PD, 1 Powered USB-C 5Gbps & 2 Powered USB-A 3.0 5Gbps Data Ports, for MacBook Pro, MacBook Air, Dell and More (Black)
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

When full mode is worth the extra services

Full mode requires PostgreSQL and RabbitMQ in addition to Redis or Valkey. It is the appropriate choice when you need account management, MFA, SSO, WebAuthn or organizations. Treat each dependency as a production service: pin versions, isolate networks, protect credentials, monitor health, back up according to your retention policy and rehearse recovery. The self-hosting overview lists the feature set and additional service requirements (official overview).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not migrate from simple to full mode casually. Plan database storage, message-queue availability, SMTP delivery, account enrollment and rollback before changing the production deployment. If users only need anonymous one-time links, simple mode avoids that complexity.

Backups, upgrades and recovery

What to back up

  • The protected root SECRET and every separately configured authentication secret.
  • Persistent Redis/Valkey data when persistence is enabled and your policy permits retaining it.
  • PostgreSQL data and RabbitMQ configuration in full mode.
  • The environment file, proxy configuration and a record of image tags, DNS and firewall settings.

Encrypt backups, restrict who can restore them, and keep them out of the public web root. A backup that contains live secret data must be governed as carefully as the running service.

Upgrade procedure

  1. Read the target release notes and confirm compatibility with your deployment mode.
  2. Back up configuration and data, then record the currently running image tag.
  3. Test the new image with a disposable instance or maintenance window.
  4. Replace the container while keeping the root secret and service endpoints unchanged.
  5. Repeat the create, retrieve, expiration and restart tests, then monitor logs and resource use.
  6. Keep the prior image available for rollback until the new version has operated normally for a period appropriate to your service.

Operational decisions to document

Self-hosting is successful when the deployment remains understandable months later. Write down the public hostname, DNS owner, VPS region, firewall rules, Docker image tags, Redis persistence mode, backup encryption and retention, certificate renewal method, administrators, alert thresholds and the exact restore sequence. The official documentation does not prescribe one universal monitoring or disaster-recovery schedule, so make these explicit operator decisions and validate them with periodic recovery tests.

For most individuals and small teams, the durable design is simple mode on a modest Linux VPS, Redis or Valkey isolated on a private network, a version-pinned container, a carefully preserved root secret and an HTTPS reverse proxy. Full mode is a deliberate expansion for account and organization features, not a default requirement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

DockerLinuxOnetime SecretRedisself-hostingServer SecurityValkeyVPS

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.