Jacob Paris
← Back to all content

Where to host your Remix app in 2023

Remix supports many different hosting options. This guide will help you choose the right one for your app.

Last updated on Oct 30 2023. Is any of this out of date? Please yell at me on Twitter and I will fix it.

Serverless Functions

Serverless functions are a form of managed hosting where application code is started and stopped on demand at request-time. Sometimes entire applications fit in a single function, or an app can be distributed across many, with each endpoint being its own function.

Serverless functions are often billed by the number of requests, the amount of time the function is running, and the amount of memory the function uses.

When a website gets a large amount of traffic, an application running on many serverless functions can simply scale up to handle the load, and scale back down when traffic resumes to normal levels.

While most serverless functions run in normal datacenters, others run on an edge network, which means they run in datacenters all over the world, close to the end user. This can reduce latency and improve performance.

In general, serverless functions run Node.js and edge functions run the very fast, but less supported, V8 runtime. On V8, many node modules are not available without polyfills.

Because of the ephemeral nature of these functions, the first request to a function may cause a cold-start and take several seconds to respond.

VercelFastlyNetlifyCloudflareSST
RuntimeNode/V8 (per route)WASMNode/V8V8Node
Bundle size50MB100MB50MB25MB50MB
Request body size4.5MBNo limit3MB100MB6MB
StreamingYesYesYesYesYes
Deferred dataYesYesYesYesYes
Server-sent eventsNoYesNoYesYes
Cache-controlYesYesYesYesYes
Git-based deploysYesNoYesYesYes
Deploy previewsYesNoYesYesYes
WebsocketsNoYesNoYesYes

Vercel

Vercel is a serverless hosting platform for web apps.

They support git-based deployments, and deploy previews for every branch and pull request, as well as some fancy collaboration tools built on top.

Vercel allows you to specify whether to use a Node runtime or a V8 Edge runtime on a per-page basis, so you can use Node functions for some pages and V8 functions for others.

As Vercel splits each endpoint into its own function, the 50MB limit for each function bundle becomes very hard to hit.

Streaming support means that with React 18, Vercel can use defer() to stop some data fetching from blocking the initial render.

  • Vercel does not support websockets, and while it does support streaming, connections can only be open for 30s so Server-Sent Events aren't practical.
  • Full cache-control support, including stale-while-revalidate and stale-if-error, as well as the s-maxage property.
  • The maximum request body size with Vercel is 4.5MB, which can be problematic for direct file uploads.
  • Only cloud databases are supported

Fastly

Fastly is a powerful CDN and hosting platform and the hosting provider of choice for the Remix + React Router docs.

Fastly supports Remix with their Compute@Edge platform. This is a serverless platform that runs on the edge, compiling Typescript down to WebAssembly.

Fastly has full cache-control header support, including stale-while-revalidate and stale-if-error. For more control, they also offer the Surrogate-Control header for making CDN specific settings.

They also offer APIs to programmatically purge the cache, which is not common.

Fastly has support for websockets, which is not common for serverless platforms.

Fastly supports streaming too, so you can use Server-Sent Events and Remix's defer()

  • Because it doesn't run node, many node modules are not compatible with Remix on Fastly. In exchange, you get the current fastest possible runtime.
  • Fastly supports a 100MB compiled bundle size limit, measured after compilation to WASM and after all compiler optimizations have been applied.
  • No git based deployments, but easy to deploy in GitHub Actions
  • Only cloud databases are supported

Netlify

Netlify is the original JAMStack hosting platform that has grown from a simple static site host to a full-featured serverless platform.

With built-in git-based deployments, every time you push to your git repo, Netlify will build and deploy your app. You can also use deploy previews to test your app before merging a pull request.

Netlify supports both Node (Netlify functions) and V8 (Netlify Edge Functions) runtimes as separate targets, so your entire app will run on one or the other.

Netlify supports powerful fine-grained cache control in a few ways

  • Cache-Tag headers which can be used to invalidate specific pages or assets
  • Netlify-Vary header, which can vary cache policies on specific headers, like device type, or specific cookie values, like user sessions or A/B tests.

You can choose which region your functions are deployed to, but you can't deploy to multiple regions at once.

  • The maximum request body size with Netlify is 3MB, which can be problematic for direct file uploads.
  • Does not support websockets

Cloudflare

Cloudflare Pages is a hosting service, like Netlify or Vercel, but built on Cloudflare's network. You get a git based deploy workflow and preview deployments for different branches.

Static content is hosted from Cloudflare's CDN and the rest of the Remix app is compiled into a single cloudflare worker on the edge. which uses the V8 runtime, so they aren't compatible with many node modules.

Cloudflare does support streaming, so you can use Server-Sent Events and Remix's defer()

Streaming support means that with React 18, Cloudflare can use defer() to stop some data fetching from blocking the initial render.

Cloudflare supports cache-control headers, including stale-while-revalidate and stale-if-error, as well as the s-maxage property. For better control, they also offer the CDN-Cache-Control header for making CDN specific settings.

Cloudflare supports a request body size of 100MB for most apps, but if you need more, you can request a limit increase. This is higher than any other serverless platform.

Websockets also work on Cloudflare, which is not common for serverless platforms.

  • Pages supports a bundle size of 25MB
  • Deployments have a 200ms startup time limit, which can be problematic as your app grows.
  • Only cloud databases are supported, and Prisma requires using their Data Platform, which has a generous free tier but is a paid service.

SST

SST is a framework for building serverless applications on AWS. It's built on top of AWS CDK, which is a framework for building cloud infrastructure.

They support Remix via the RemixSite construct which will deploy your app to AWS Lambda or AWS Lambda@Edge and using Cloudfront as a CDN.

  • Git based deploys are not included, but you can easily set up your own with a Github Action or by using Seed, the deployment infrastucture tool that is built by the SST team.
  • Preview and staging environments are created via the SST CLI, which you can do in a Github Action.

Long-lived servers

A more traditonal approach to application hosting is to run your application on a long-lived server. The server (or servers) remain running and handle requests as they come in.

There are no cold start issues with long-running servers, but there is the potential for scaling issues if your app gets a large amount of traffic.

Since the server runs even when there is no traffic, they are often more expensive than serverless functions for the same app.

Servers usually have full access to the file system, to spawning child processes, to streaming responses, deferred data, server-sent events, running websocket servers in parallel with your app, and more.

FlyRenderRailwayDigitalOcean
Git based deploymentsNoYesYesYes
Preview environmentsNoYesNoNo
Staging environmentsYesNoYesNo
Static assets CDNYesNoNoYes
Multi-region deploysYesNoNoNo

Fly.io

Fly.io is a managed container platform that runs on the edge.

One of Fly's biggest advantages is its multi-region support. You can deploy your app to any of Fly's 20+ regions, and Fly will automatically replicate your app to every region you deploy to. This means that your app will be closer to your users, and will be more resilient to outages.

You can scale the amount of RAM and CPU provisioned for your app with a simple CLI command. By default, Fly will give you 256MB of RAM, but this is pretty slim for Remix apps, and I recommend 512MB as a reasonable minimum for most apps.

The number of available machines to serve your app can also be configured, and you can tell fly to autoscale within a range. This is useful for autoscaling to zero for low traffic applications.

Fly also supports Postgres and Redis databases that can be deployed alongside your app and replicated across every region you deploy to.

Fly offers a CDN for serving static assets, but does not offer APIs to programmatically purge the cache. Cache-control headers are supported, including stale-while-revalidate and stale-if-error.

  • There is no built in git based deployments, but easy to set up in GitHub Actions
  • No preview environments. You can use FlyCD for automatic preview environments on Fly.io
  • Fly has an 8GB uncompressed docker image limit
  • Fly has a 10MB request body buffer, but can handle larger bodies by streaming them

Render

Render is a managed hosting platform that supports Remix without needing Docker, though you still have the ability to package your app as a Docker image if you have special dependencies you want to install.

Render supports git based deployments, so you just need to push code to your git repo and Render will deploy it. They also support preview environments for their Team plans.

Their built in databases are Postgres and Redis, though nothing stops you from spinning up new containers running anything else.

  • There is no multi-region support like Fly
  • No staging environments, but with their preview environments you don't need them
  • Render has no request body size limit
  • They don't seem to have published their bundle/image limits

Railway

Railway is a managed container hosting platform. If you don't supply your own Dockerfile, Railway will let you deploy without it.

Railway supports git based deployments, so you just need to push code to your git repo and Railway will deploy it. They also support preview environments for their Team plans.

For databases, Railway has built-in support for Postgres, MySQL, Redis, and MongoDB, and they have a web UI for managing them as well.

  • Railway supports deploying to different continental regions, but no multi-region support like Fly
  • No automatic preview environments, but it's easy to set up staging environments

DigitalOcean App Platform

DigitalOcean App Platform is a managed container hosting platform. If you don't supply your own Dockerfile, DigitalOcean will let you deploy without it.

DigitalOcean supports git-based deployments and also offers a Github action for more advanced deployment workflows.

Postgres, MySQL, Redis, and MongoDB databases can be deployed from the DigitalOcean web console alongside your application.

  • There is no multi-region support like Fly
  • No automatic preview environments or built-in staging environments
Professional headshot
Moulton
Moulton

Hey there! I'm a developer, designer, and digital nomad building cool things with Remix, and I'm also writing Moulton, the Remix Community Newsletter

About once per month, I send an email with:

  • New guides and tutorials
  • Upcoming talks, meetups, and events
  • Cool new libraries and packages
  • What's new in the latest versions of Remix

Stay up to date with everything in the Remix community by entering your email below.

Unsubscribe at any time.