<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alphasec</title>
    <description>The latest articles on DEV Community by Alphasec (@alphasec).</description>
    <link>https://dev.to/alphasec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3890949%2F3af0bd1c-221d-4e11-b1a4-afb2d22e198e.png</url>
      <title>DEV Community: Alphasec</title>
      <link>https://dev.to/alphasec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alphasec"/>
    <language>en</language>
    <item>
      <title>A Developer Built an Open-Source Dropbox on a Dare. Here's How to Self-Host It.</title>
      <dc:creator>Alphasec</dc:creator>
      <pubDate>Tue, 21 Apr 2026 16:23:55 +0000</pubDate>
      <link>https://dev.to/alphasec/a-developer-built-an-open-source-dropbox-on-a-dare-heres-how-to-self-host-it-39mi</link>
      <guid>https://dev.to/alphasec/a-developer-built-an-open-source-dropbox-on-a-dare-heres-how-to-self-host-it-39mi</guid>
      <description>&lt;p&gt;A few weeks ago, &lt;a href="https://x.com/swyx" rel="noopener noreferrer"&gt;@swyx&lt;/a&gt; nerd-sniped &lt;a href="https://x.com/zachmeyer" rel="noopener noreferrer"&gt;@zachmeyer&lt;/a&gt; into building an open-source Dropbox. Zach took it seriously, and the result is &lt;a href="https://locker.dev/" rel="noopener noreferrer"&gt;Locker&lt;/a&gt;: a self-hostable file storage platform that covers most of what you'd actually use Dropbox or Google Drive for, without the subscription or lock-in.&lt;/p&gt;

&lt;p&gt;I came across the thread on X, spent some time getting Locker running on &lt;a href="https://railway.com/?referralCode=alphasec" rel="noopener noreferrer"&gt;Railway&lt;/a&gt;, and figured the deployment notes were worth writing up — especially since the setup has a few non-obvious pieces that trip you up if you're looking to self-host.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Locker Actually Is
&lt;/h2&gt;

&lt;p&gt;Locker is a Dockerized Next.js application backed by PostgreSQL. The &lt;a href="https://github.com/zmeyer44/Locker" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt; is worth a look — the tech stack is modern and clean: Next.js 16 App Router, tRPC for end-to-end type safety, Drizzle ORM, BetterAuth, and Tailwind CSS, organized as a Turborepo monorepo with pnpm workspaces.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhn9zxtntrkhqp79fxfe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyhn9zxtntrkhqp79fxfe.png" alt="Locker" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feature-wise it covers the things you'd actually miss from the commercial alternatives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File and folder management&lt;/strong&gt; — upload, rename, move, delete, with a familiar explorer UI&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Share links&lt;/strong&gt; — password protection, expiry dates, and download limits per link&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Upload links&lt;/strong&gt; — let anyone send you files without an account, useful for collecting documents from clients or collaborators&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage provider agnostic&lt;/strong&gt; — switch between local disk, AWS S3, Cloudflare R2, or Vercel Blob via a single environment variable, no code changes required&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Locker as an S3 bucket&lt;/strong&gt; — generate Locker API keys and use them in other applications to write data directly to your Locker instance; it speaks S3-compatible protocol&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Per-user storage quotas&lt;/strong&gt; — set limits per user with usage tracking&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Workspace teams&lt;/strong&gt; — invite team members with role-based access and organise files across workspaces&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QMD semantic search&lt;/strong&gt; (optional plugin) — search inside the content of your files, not just filenames&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;FTS full-text search&lt;/strong&gt; (optional plugin) — full-text search across your stored documents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Email/password and Google OAuth&lt;/strong&gt; — authentication handled by BetterAuth, sessions managed server-side&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API keys&lt;/strong&gt; — programmatic access for building integrations and automating workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Virtual bash shell&lt;/strong&gt; — navigate your file tree with &lt;code&gt;ls&lt;/code&gt;, &lt;code&gt;cd&lt;/code&gt;, &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;cat&lt;/code&gt;, and &lt;code&gt;grep&lt;/code&gt; via a terminal panel; reads your actual stored files lazily from the configured storage provider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The last one is either delightful or unnecessary depending on your personality.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Storage Provider Thing Is the Key Insight
&lt;/h2&gt;

&lt;p&gt;Most self-hosted file storage tools tie you to a specific backend. Locker doesn't. You set &lt;code&gt;BLOB_STORAGE_PROVIDER&lt;/code&gt; in your environment and point it at wherever you want files to live:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;What you need&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Local disk&lt;/td&gt;
&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Just a directory path&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AWS S3&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Access key, secret, region, bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare R2&lt;/td&gt;
&lt;td&gt;&lt;code&gt;r2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Account ID, keys, bucket&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Vercel Blob&lt;/td&gt;
&lt;td&gt;&lt;code&gt;vercel&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;A read/write token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you already have an S3 bucket, you can point Locker at it and immediately have a UI over your existing data. If you're starting fresh, local disk works out of the box. Switching later is one variable change.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying Locker
&lt;/h2&gt;

&lt;p&gt;Locker is designed to run with Docker Compose — a &lt;code&gt;migrate&lt;/code&gt; container runs the database migrations first, then the &lt;code&gt;web&lt;/code&gt; container starts once migrations complete. That's the intended flow.&lt;/p&gt;

&lt;p&gt;Deploying to &lt;a href="https://railway.com/?referralCode=alphasec" rel="noopener noreferrer"&gt;Railway&lt;/a&gt; takes a bit more work because Railway runs a single container rather than orchestrating multiple services. I spent some time getting this right: the key issue is that migrations need to run before the app starts, and the Dockerfile in the repo builds a Next.js standalone output that doesn't include the migration tooling in the final image by default.&lt;/p&gt;

&lt;p&gt;The solution was a custom &lt;code&gt;Dockerfile.railway&lt;/code&gt; that copies the migration dependencies into the runner stage and runs them as part of the startup command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["sh", "-c", "cd /app/packages/database &amp;amp;&amp;amp; pnpm drizzle-kit migrate &amp;amp;&amp;amp; cd /app &amp;amp;&amp;amp; node apps/web/server.js"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Drizzle tracks which migrations have already been applied, so this is idempotent — subsequent deploys only apply new migrations and skip the rest.&lt;/p&gt;

&lt;p&gt;If you want to skip all of this and just get a running instance, I published a one-click &lt;a href="https://railway.com/deploy/locker-or-self-hostable-dropbox-or-googl?referralCode=alphasec" rel="noopener noreferrer"&gt;Railway template&lt;/a&gt; that handles everything automatically — Postgres, volume for file storage, migrations on startup, and all the required environment variables pre-configured:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://railway.com/deploy/locker-or-self-hostable-dropbox-or-googl?referralCode=alphasec" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdza8fa0foe3c7h7osnqq.png" alt="Deploy on Railway" width="366" height="80"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;After deployment you get a clean file management interface, workspace support for teams, and the ability to generate share links for any file or folder. The virtual bash shell is accessible via a terminal panel and lets you navigate your file tree with standard Unix commands — which turns out to be genuinely useful when you want to script something against your stored files.&lt;/p&gt;

&lt;p&gt;Authentication supports email/password out of the box, and you can add Google OAuth by dropping in &lt;code&gt;GOOGLE_CLIENT_ID&lt;/code&gt; and &lt;code&gt;GOOGLE_CLIENT_SECRET&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is It Ready for Production?
&lt;/h2&gt;

&lt;p&gt;For personal use and small teams, maybe yes. For a large organisation relying on it as primary infrastructure, I'd want to see more production mileage first — the project is still relatively young. That said, the tech choices are solid, the codebase is readable, and the maintainer is active.&lt;/p&gt;

&lt;p&gt;The hosted version at &lt;a href="https://locker.dev/" rel="noopener noreferrer"&gt;locker.dev&lt;/a&gt; is available if you want to try it before committing to self-hosting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Further Reading
&lt;/h2&gt;

&lt;p&gt;I write about cloud, security, privacy, and self-hosted infrastructure at &lt;a href="https://alphasec.io/" rel="noopener noreferrer"&gt;alphasec.io&lt;/a&gt;. If &lt;a href="https://railway.com/?referralCode=alphasec" rel="noopener noreferrer"&gt;Railway&lt;/a&gt; templates are your thing, I maintain a collection covering everything from starter kits to AI apps and security tools.&lt;/p&gt;

</description>
      <category>selfhosted</category>
      <category>opensource</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
