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
| Provider | Best For | Free Tier | Custom Domain | CDN | Edge Functions |
|---|---|---|---|---|---|
| EAS Hosting | Expo projects, unified mobile+web | Yes | Yes (paid) | Yes | Yes |
| Vercel | Next.js-like experience, edge network | Yes | Yes | Yes | Yes |
| Netlify | Simple deployment, forms | Yes | Yes | Yes | Yes |
| Cloudflare Pages | Global CDN, speed | Yes | Yes | Yes | Yes |
| GitHub Pages | GitHub repositories, free hosting | Yes | Limited | No | No |
| AWS Amplify | AWS ecosystem integration | Free tier | Yes | Yes | Limited |
| Render | Full-stack apps, databases | Free tier | Yes | Yes | No |
EAS Hosting (Recommended for Expo)
EAS Hosting provides seamless integration with Expo projects and unified deployment for mobile and web.Install EAS CLI
Deploy to EAS Hosting
- Upload your dist directory
- Deploy to global CDN
- Provide a preview URL:
https://[project].exp.app
Set Up Custom Domain (Optional)
Available on paid plans:- Go to EAS Dashboard
- Navigate to your project > Hosting
- Click Custom domain
- Add your domain and configure DNS:
EAS Hosting Features
Unified deployment:- Deploy web alongside mobile builds
- Single command for all platforms
- Integrated with EAS Update for mobile
- Server functions via Cloudflare Workers
- Monitor API logs in dashboard
- Built-in crash reporting
- Global CDN distribution
- Automatic compression
- Edge caching
Vercel
Vercel offers excellent performance and developer experience, similar to their Next.js platform.Install Vercel CLI
Deploy
- Link to existing project or create new
- Configure project settings
- Deploy
- Preview URL:
https://[project]-[hash].vercel.app - Production URL:
https://[project].vercel.app
Deploy from Git (Recommended)
- Push code to GitHub/GitLab/Bitbucket
- Go to Vercel Dashboard
- Click New Project
- Import your repository
- Configure:
- Build Command:
npx expo export --platform web - Output Directory:
dist
- Build Command:
- Deploy
Custom Domain
- Go to Project Settings > Domains
- Add your domain
- Configure DNS:
- SSL automatically provisioned
Vercel Environment Variables
Add environment variables in dashboard or via CLI:Netlify
Netlify provides simple deployment with great CI/CD integration and form handling.Install Netlify CLI
Deploy
- Go to Netlify Dashboard
- Click New site from Git
- Connect repository
- Build settings auto-detected from netlify.toml
- Deploy
Custom Domain
- Go to Site settings > Domain management
- Add custom domain
- Configure DNS:
- Enable HTTPS (automatic)
Netlify Features
Forms: Add forms with zero configuration:netlify.toml
Cloudflare Pages
Cloudflare Pages offers global CDN with excellent performance and security.Create Cloudflare Account
Sign up at Cloudflare PagesDeploy from Git
- Go to Cloudflare Pages dashboard
- Click Create a project
- Connect to GitHub/GitLab
- Select repository
- Configure build:
- Build command:
npx expo export --platform web - Build output directory:
dist - Root directory: (leave empty or set if monorepo)
- Build command:
Custom Domain
- Go to Custom domains
- Add your domain
- Configure DNS (if domain not on Cloudflare):
Or migrate nameservers to Cloudflare for automatic setup
Cloudflare Workers
Add serverless functions:functions/api/hello.js
https://[project].pages.dev/api/hello
GitHub Pages
Free hosting for public repositories with GitHub.Install gh-pages
Deploy
- Exports your app to dist
- Pushes dist to
gh-pagesbranch - GitHub Pages serves from that branch
Configure Repository
- Go to repository Settings > Pages
- Source: gh-pages branch
- Custom domain: Enter your domain (optional)
- Enforce HTTPS: Enabled
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.Install Amplify CLI
Deploy from Console
- Go to AWS Amplify Console
- Click New app > Host web app
- Connect repository (GitHub, GitLab, Bitbucket, CodeCommit)
- Configure build:
- Build command:
npx expo export --platform web - Output directory:
dist
- Build command:
- Deploy
Custom Domain
- Go to App settings > Domain management
- Add domain
- Amplify handles DNS configuration automatically
- Or manually configure:
Amplify Features
Branch deployments:- Preview URLs for each branch
- Automatic builds on pull requests
- Managed in Amplify Console
- Different values per branch/environment
Render
Render provides free static site hosting with automatic SSL.Deploy Static Site
- Click New > Static Site
- Connect GitHub/GitLab
- Select repository
- Configure:
- Build Command:
npx expo export --platform web - Publish Directory:
dist
- Build Command:
- Create Static Site
Custom Domain
- Go to site Settings > Custom Domain
- Add domain
- Configure DNS:
- 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
netlify.toml
Security Headers
Add security headers to protect your app:netlify.toml
Monitoring and Analytics
Google Analytics:app/_layout.tsx
app/_layout.tsx
Troubleshooting
404 Errors on Refresh
Issue: Routes return 404 when directly accessed or refreshed Solution: Configure redirects to index.html:- Tab Title
- Tab Title
- Tab Title
vercel.json
Environment Variables Not Working
Issue:process.env.EXPO_PUBLIC_* is undefined
Solutions:
-
Prefix with EXPO_PUBLIC_:
-
Add to hosting provider:
- Vercel: Project Settings > Environment Variables
- Netlify: Site settings > Build & deploy > Environment
- Cloudflare: Settings > Environment variables
- 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:-
Node version matches:
package.json
-
Install script:
- Check build logs for specific errors
Next Steps
- Static Export - Learn more about creating static exports
- Build Configuration - Configure for mobile platforms
- Over-the-Air Updates - Update mobile apps remotely