Introduction to EAS Hosting

Edit page

EAS Hosting is a service for quickly deploying web projects built using the Expo Router library and React Native web.


EAS Hosting is a service from EAS (Expo Application Services) for quickly deploying your web projects built using Expo Router and React Native web. It seamlessly integrates with the Expo CLI, allowing you to automate the deployment of API routes, server functions, and server-side assets.

EAS Hosting offers the fastest path from npx create-expo-app to a fully deployed web app with API routes and server functions.

Quick start

To deploy your web app, you need to create a static build of your web project. Run the following command to export your web project into a dist directory:

Terminal
- npx expo export --platform web

To publish your web app, run the following command:

Terminal
- eas deploy

Once your deployment is complete, the EAS CLI will output a preview URL to access your deployed web app.

Why EAS Hosting

Historically, traditional website hosting services were recommended for deploying Expo Router and React apps. However, this approach doesn't address the unique challenges of dealing with native apps. Here are some key limitations:

  • Version synchronization: During the app store publishing process, you may need to deploy new versions of your servers.

  • Request routing complexity: Different versions of your native app may require routing to specific server versions. This can create additional complexity when handling requests.

  • Platform-specific analysis: When running native apps, you need enhanced observability for platform-specific metrics.

EAS Hosting addresses these limitations by providing a unified deployment experience across all platforms.

When to use EAS Hosting

ScenarioRecommendation
Deploy a web build without setting up a separate hosting provider
Use API routes or server functions in your Expo Router app
Maintain consistent deployment workflows across Android, iOS, and web
Automate deployments using EAS Workflows
Built-in monitoring for server-side code crashes, logs, and requests
Mobile-only project with no web component
Full Node.js runtime compatibility (EAS Hosting uses Cloudflare Workers runtime with partial Node.js support)
Already have established web infrastructure that meets your needs

Frequently asked questions (FAQ)

What web output modes can I use with EAS Hosting?

EAS Hosting supports all three output modes configured in your app config's expo.web.output:

Can I use API routes with EAS Hosting?

EAS Hosting fully supports API routes (files ending with +api.ts) when using the server output mode. You can monitor crashes, logs, and requests from your API routes in the EAS dashboard.

What runtime does EAS Hosting use?

EAS Hosting is built on Cloudflare Workers, which runs on the V8 JavaScript engine. It uses V8 isolates instead of full Node.js processes. Node.js compatibility modules are available but with some limitations. See the worker runtime reference for the full list of supported modules.

Can I set up a custom domain for my production deployment?

Custom domains are available on paid plans. Each project can have one custom domain assigned to the production deployment. Both apex domains and subdomains are supported.

How can I create deployment aliases?

EAS Hosting deployments are immutable. Each deployment gets a unique preview URL. You can create aliases to assign custom names to deployments (such as staging or production). Since deployments are immutable, you can instantly roll back by reassigning an alias to a previous deployment ID using eas deploy:alias --prod --id=<deploymentId>.

What monitoring capabilities are available in EAS Hosting?

EAS Hosting provides built-in monitoring in the EAS dashboard:

  • Crashes: View uncaught errors from API routes, grouped by similarity
  • Logs: All console.log, console.info, and console.error output from API routes
  • Requests: Request metadata including status, browser, region, and duration
How can I configure caching in EAS Hosting?

API routes can return Cache-Control directives that EAS Hosting uses to cache responses on its global CDN (Content Delivery Network). Static assets are cached with a default browser cache time of 3600 seconds. See the Caching reference for details.

Can I use EAS Hosting with EAS Workflows?

EAS Hosting integrates with EAS Workflows using the deploy job type. You can add a deploy job to your workflow configuration. For example:

jobs: deploy_web: type: deploy environment: production params: prod: true

You can also deploy to a specific alias or make production conditional based on the branch:

jobs: deploy: type: deploy params: prod: ${{ github.ref_name == 'main' }}

For more information, see the Web deployments with EAS Workflows.

Get started

Create your first deployment

From a new app to a deployed website in under a minute.

Assign deployment aliases

Create aliases and promote deployments to production.

Configure environment variables

Use environment variables in your web and server code.

Custom domain

Set up a custom domain for your production deployment.

API Routes

Inspect requests from API routes on the EAS Hosting dashboard.

Deploy with EAS Workflows

Automate deployments with EAS Workflows.