App Platform retrieves your app’s code from your linked repository or container registry, detects the type of language the app is written in, and deploys the app into an appropriate container environment. Your app’s code can be in a GitHub repository, a GitLab repository, a container image you uploaded to DigitalOcean Container Registry or Docker Hub, or a sample app we provide. App Platform hosts the app at a public URL provided by DigitalOcean and can also automatically redeploy the app when it detects changes in the repo.
To create an App using the DigitalOcean Control Panel, click the Create button and then select Apps from the drop-down menu.
On the Choose Resource From Source Code screen, select the code repository service your app resides on. If you have not previously created an app on App Platform, the repository service prompts you to provide DigitalOcean with read permissions to your account.
Select the app’s repo from the Repository drop-down and then select the branch to deploy from in the Branch drop-down menu.
The Source Directory is the directory inside the repo from which to build the app from. The default is the repo’s root directory. For a GitHub monorepo, specify the folder that contains the source. For more information, see Deploy from a Monorepo for more information on how App Platform builds apps from monorepos.
You can choose to opt out of auto-deploying code changes. Uncheck the Autodeploy code changes box to disable App Platform from redeploying the app when it detects changes in the app’s repo.
Once you have selected the app’s repo and branch, click Next. App Platform retrieves your app’s code.
App Platform inspects the code and app resources, and selects an appropriate runtime environment (such as Node, or Ruby). If you need to override this, upload a Dockerfile to your branch and restart the app creation process.
Resources are deployable runtime software elements in your app. A resource can be a database, a service, a worker, or a static site. On the Resources screen, you can scale your app, configure resource settings or create new resources for your app.
Click Scale on the Resources screen to scale the app resources.
On the Scale screen, you can select a plan as well as scale the app resources vertically by increasing the amount of CPU and memory or horizontally by adding more container instances.
As you change the size or the number of containers, the Monthly App Cost section updates to give you an overview of the app’s monthly cost.
For static sites, the Scale screen shows information about the number of apps on your account along with the static site’s name and other resources.
After you configure your scaling settings, click Back to go back to the Resources screen.
To configure the app resource settings, click the edit icon corresponding to the resource on the Resources screen.
App Platform presents several configuration options, several of which may have been auto-filled during the app’s detection. You can configure the following options for your app:
npm start
for a Node.js app.8080
.your-app-v3cl4.ondigitalocean.app/api
. If not specified, the app will be accessible from the provided hostname’s root._static
, dist
, public
, build
.App Platform displays build and run commands that it detected, which you can customize as needed. Refer to the cloud-native buildpacks for instructions for specific buildpacks. For Dockerfile-based builds, entering a run command overrides the Dockerfile’s entrypoint.
After you configure the resource settings, click Back to go back to the Resources screen.
Once you configure your app, you can optionally create additional resources for the app. In the Create Resource section of the Resources screen, select the type of resource in the Resource Type section.
For service, worker, or static site: Select the Detect from Source Code option and click Create. Select the resource from your repository, container registry, or sample app and click Next.
For database: Select the Database option and click Next. Choose the Dev Database option to connect a small development-level PostgreSQL database to your app and click Create and Attach. We do not recommend using this initial size for production-ready apps, but you can upgrade the database to a production-ready size at a later time. Alternatively, you can select the Previously Created DigitalOcean Database option and click Attach Database to attach an existing DigitalOcean database to your app as a resource. All DigitalOcean database clusters support apps as trusted sources. This creates a secure connection to the database and it accepts traffic only from the app.
The new resources are added to your app and appear on the Resources screen.
Once you configure the resources, click Next.
If your app requires environment variables, such as app’s the URL or database connection strings, you can define them in this section. These can be runtime and build time environment variables. We also provide several app-specific dynamic environment variables that the app can reference. App-level variables can be accessed by all resources in your app.
On the Environment screen, click the corresponding Edit link to specify app-level or resource-specific environment variables. Click the Encrypt checkbox to obscure the variable’s values from all build, deployment, and application logs.
Once you configure the environment variables, click Next.
On the Info screen, click Edit to specify the name of your app in the Name field. The name can only contain lowercase alphanumeric characters and dashes.
In the Region field, select a datacenter region for the app to reside in. For performance purposes, it is best to select the region geographically closest to the app’s user base.
You cannot select a region for static sites. Static resources are served on DigitalOcean’s global CDN.
Once you enter a name for your app and select a region, click Next.
On the Review screen, review your app’s resources, environment variables and billing information and then click Create Resources.
Once your app deploys, you can view the app at the URL at the top of the app’s Overview page.