Host your Expo app anywhere

Export your JS bundle and assets so your app pulls OTA updates from your server

Quinlan Jung
Exposition

--

Github Pages provides an easy way to statically host your Expo app

Update: The post below is out of date and left here for historical reference. Learn more about Expo Application Services (EAS), which is the fastest way to get your Expo app from development to the app stores.

We are excited to announce that you are now able to host your Expo app from any server of your choice. The JS and some assets for Expo apps are typically hosted by Expo and served through our globally distributed CDN. When you run expo publish, the CLI gathers all your assets and sends them to Expo’s servers. Then when users run your app, it knows to check Expo’s servers for updates. This is convenient, high-performance, and works well for most developers, but some developers have asked for a way to host their code and assets themselves.

Why host your app

Most users choose to host their app on Expo’s CDN because it is performant and configurable, but there will be cases where it makes sense for a user to host their app on their own servers. For example, over-the-air updates are slow or unusable in countries that have blocked our CDN providers on AWS and Google Cloud. In other cases, your company may have security policies mandating that all app data be stored on company servers. You can now easily configure your Expo app to pull OTA updates from your own servers to better suit your needs.

Export your app

Here’s how the process works in 3 simple steps:

  1. Create an Expo app and install expo-cli (npm install -g expo-cli).
  2. Run expo export¹. This will generate an output directory for you to host from a server of your choice.
  3. Run expo build², passing in your server name as a parameter. This will build an ipa or apk binary that will grab over-the-air (OTA) updates from your server as new JS bundles and assets become available.

You can find out more from our docs, where we go over how to host your app using Github Pages.

Making changes to your app

Whenever you update your app and want to deploy those changes to your server, simply run expo export³ again and host the contents of the newly generated output directory. Please note that we only support OTA updates to your JS code and assets. If you’ve made changes to your native code, you will need to resubmit your app to Google Play/App Store.

ExpoKit apps

Our export tools also work on ExpoKit apps, and you do not need to take any additional steps in order to export them.

Release Details:

  • We added a new command to the Expo CLI called expo export, which exports a set of files you can host from any static web server your app can access.
  • To learn about the technical details behind this feature, watch my talk from React Native EU 2018 (22 minutes).

Feel free to reach out on our forums or on twitter @expo if you have any questions!

Footnotes:

[1, 2, 3] with some additional parameters, see here for more details.

--

--