Skip to main content

Web Hosting Providers

After creating a static export of your Expo Router web app, you can deploy it to any static hosting provider. This guide covers popular options with step-by-step deployment instructions.

Choosing a Hosting Provider

EAS Hosting provides seamless integration with Expo projects and unified deployment for mobile and web.
1

Export Your App

Create a static build:
This creates a dist directory with your static files.
2

Install EAS CLI

3

Deploy to EAS Hosting

EAS CLI will:
  1. Upload your dist directory
  2. Deploy to global CDN
  3. Provide a preview URL: https://[project].exp.app
4

Set Up Custom Domain (Optional)

Available on paid plans:
  1. Go to EAS Dashboard
  2. Navigate to your project > Hosting
  3. Click Custom domain
  4. Add your domain and configure DNS:
5

Configure Deployment Aliases

Create production alias:

EAS Hosting Features

Unified deployment:
  • Deploy web alongside mobile builds
  • Single command for all platforms
  • Integrated with EAS Update for mobile
API routes support:
  • Server functions via Cloudflare Workers
  • Monitor API logs in dashboard
  • Built-in crash reporting
Automatic optimization:
  • Global CDN distribution
  • Automatic compression
  • Edge caching

Vercel

Vercel offers excellent performance and developer experience, similar to their Next.js platform.
1

Install Vercel CLI

2

Configure Vercel

Create vercel.json in your project root:
vercel.json
For static export (not server mode), use the rewrite configuration above to handle client-side routing.
3

Deploy

Follow prompts to:
  1. Link to existing project or create new
  2. Configure project settings
  3. Deploy
Vercel provides:
  • Preview URL: https://[project]-[hash].vercel.app
  • Production URL: https://[project].vercel.app
4
  1. Push code to GitHub/GitLab/Bitbucket
  2. Go to Vercel Dashboard
  3. Click New Project
  4. Import your repository
  5. Configure:
    • Build Command: npx expo export --platform web
    • Output Directory: dist
  6. Deploy
Automatic deployments on every push to main branch.
5

Custom Domain

  1. Go to Project Settings > Domains
  2. Add your domain
  3. Configure DNS:
  4. SSL automatically provisioned

Vercel Environment Variables

Add environment variables in dashboard or via CLI:
Or in vercel.json:

Netlify

Netlify provides simple deployment with great CI/CD integration and form handling.
1

Install Netlify CLI

2

Configure Netlify

Create netlify.toml in project root:
netlify.toml
3

Deploy

Or connect to Git:
  1. Go to Netlify Dashboard
  2. Click New site from Git
  3. Connect repository
  4. Build settings auto-detected from netlify.toml
  5. Deploy
4

Custom Domain

  1. Go to Site settings > Domain management
  2. Add custom domain
  3. Configure DNS:
  4. Enable HTTPS (automatic)

Netlify Features

Forms: Add forms with zero configuration:
Split testing: A/B test different branches:
netlify.toml

Cloudflare Pages

Cloudflare Pages offers global CDN with excellent performance and security.
1

Create Cloudflare Account

Sign up at Cloudflare Pages
2

Deploy from Git

  1. Go to Cloudflare Pages dashboard
  2. Click Create a project
  3. Connect to GitHub/GitLab
  4. Select repository
  5. Configure build:
    • Build command: npx expo export --platform web
    • Build output directory: dist
    • Root directory: (leave empty or set if monorepo)
3

Configure _redirects

Create public/_redirects for client-side routing:
public/_redirects
4

Custom Domain

  1. Go to Custom domains
  2. Add your domain
  3. Configure DNS (if domain not on Cloudflare):
    Or migrate nameservers to Cloudflare for automatic setup

Cloudflare Workers

Add serverless functions:
functions/api/hello.js
Access at: https://[project].pages.dev/api/hello

GitHub Pages

Free hosting for public repositories with GitHub.
1

Install gh-pages

2

Configure package.json

Add deployment scripts:
package.json
For custom domain:
3

Create CNAME file

For custom domains, create public/CNAME:
public/CNAME
4

Deploy

This:
  1. Exports your app to dist
  2. Pushes dist to gh-pages branch
  3. GitHub Pages serves from that branch
5

Configure Repository

  1. Go to repository Settings > Pages
  2. Source: gh-pages branch
  3. Custom domain: Enter your domain (optional)
  4. Enforce HTTPS: Enabled
6

Configure DNS (Custom Domain)

GitHub Pages Limitations

  • Single-page app routing requires workaround
  • No server-side logic
  • 100GB bandwidth/month limit
  • 1GB repository size limit

AWS Amplify

AWS Amplify integrates with AWS services and provides full CI/CD.
1

Install Amplify CLI

2

Deploy from Console

  1. Go to AWS Amplify Console
  2. Click New app > Host web app
  3. Connect repository (GitHub, GitLab, Bitbucket, CodeCommit)
  4. Configure build:
    • Build command: npx expo export --platform web
    • Output directory: dist
  5. Deploy
3

Configure amplify.yml

Create amplify.yml for custom build:
amplify.yml
4

Custom Domain

  1. Go to App settings > Domain management
  2. Add domain
  3. Amplify handles DNS configuration automatically
  4. Or manually configure:

Amplify Features

Branch deployments:
  • Preview URLs for each branch
  • Automatic builds on pull requests
Environment variables:
  • Managed in Amplify Console
  • Different values per branch/environment

Render

Render provides free static site hosting with automatic SSL.
1

Create Account

Sign up at Render
2

Deploy Static Site

  1. Click New > Static Site
  2. Connect GitHub/GitLab
  3. Select repository
  4. Configure:
    • Build Command: npx expo export --platform web
    • Publish Directory: dist
  5. Create Static Site
3

Custom Domain

  1. Go to site Settings > Custom Domain
  2. Add domain
  3. Configure DNS:
  4. SSL automatically provisioned

Deployment Best Practices

Automated Deployments

Set up CI/CD for automatic deployments:
.github/workflows/deploy.yml

Environment-Specific Builds

Use different configurations per environment:
package.json

Performance Optimization

Enable compression: Most hosts enable automatically, but verify:
netlify.toml
Cache static assets:
netlify.toml
Optimize images: Use Cloudflare Images, Vercel Image Optimization, or similar:

Security Headers

Add security headers to protect your app:
netlify.toml

Monitoring and Analytics

Google Analytics:
app/_layout.tsx
Vercel Analytics:
app/_layout.tsx

Troubleshooting

404 Errors on Refresh

Issue: Routes return 404 when directly accessed or refreshed Solution: Configure redirects to index.html:
vercel.json

Environment Variables Not Working

Issue: process.env.EXPO_PUBLIC_* is undefined Solutions:
  1. Prefix with EXPO_PUBLIC_:
  2. Add to hosting provider:
    • Vercel: Project Settings > Environment Variables
    • Netlify: Site settings > Build & deploy > Environment
    • Cloudflare: Settings > Environment variables
  3. Rebuild app (env vars are embedded at build time)

Assets Not Loading

Issue: Images/fonts return 404 Solution: Use absolute paths from root:

Build Fails on Hosting Provider

Issue: Build works locally but fails in CI Check:
  1. Node version matches:
    package.json
  2. Install script:
  3. Check build logs for specific errors

Next Steps