Was this page helpful?

Hosting an app

For an app to be accessible, Contentful needs to know the public URL of the app. For backend apps using App Events, you will need to provide the public URL. For frontend apps, you also have the option to host directly with Contentful.

Hosting with Contentful

When hosting with Contentful, you upload your build folder which creates an AppBundle. You can upload multiple AppBundles for the same app, just like you would deploy a different version for your website with each update. You can promote or roll them back at any time.

Keep in mind to include an index.html file in the output folder root as an entry point. There is also a limit of 10MB and a maximum of 500 files for each upload.

To upload an AppBundle, you can use the app management view and upload your output folder directly under the "Bundles" tab.

Before uploading, make sure to build your code first (npm run build).

You can also use create-contentful-app on your CLI of choice. Running npm run upload will run you through the necessary steps for uploading your code.

Using CLI for AppBundle

If you haven't used create-contentful-app for bootstrapping, or are using an earlier version of it, you can run the global command npx @contentful/app-scripts upload.

Hosting an app outside of Contentful

It is also possible to use any static site hosting by linking your app's public URL in your AppDefinition. You can achieve this by toggling off the "Hosted by Contentful" option in the app management view under the "General" tab. This allows you to enter a URL for your app instead.

Using CLI for AppBundle