Deploy an App and Provision a Heroku Postgres Database
Heroku is an app platform that provides everything necessary to deploy, run, manage, and scale applications—web applications, APIs, or RESTful microservices—using open source languages, such as Java, Ruby, PHP, Python, Go, and Node.js.
The Heroku developer experience is an app-centric approach for software delivery integrated with popular developer tools and workflows.
Heroku supports many popular programming languages. However, this quick start just uses Node. If you're familiar with programming in any of the other above-mentioned languages and with using a command-line interface on a shell terminal, you'll have no problem following along.
This quick start guides you through deploying an app, deploying add-ons such as Heroku Postgres, and using Heroku Connect, a Heroku add-on that syncs data from a Salesforce org to a Heroku Postgres database connected to the app.
Deploy an Application
In this section, you'll kick-start your app development by deploying an app using Heroku Button, which automates much of the application deployment and setup.
- Navigate to https://signup.heroku.com and create a Heroku account.
- Deploy the sample Phone Change App by following the instructions after clicking this Heroku Button:
Note: If you see a dialog that says the GitHub repository is private, you can still access it by connecting your Heroku account to a GitHub account
If you don't specify a name for the app, a unique name is generated, like
United Statesas the Region, then click Deploy App.
Note: Clicking the Heroku Button kicks off the deployment. Heroku fetches the source code for the application, gets any code dependencies for that application, and creates an application by running the code in a dyno, which is a managed container.
The application is immediately available at something like
After the app has been deployed, you can manage it in the
Heroku Dashboard by clicking the
Manage App button and view the app by clicking the
Provision the Heroku Postgres Add-On
Now you are going to deploy an add-on. Heroku add-ons are cloud services, such as databases, monitoring services, caching services, and queuing systems, that can be instantly provisioned for an application.
In this step, you provision a relational database by adding the Heroku Postgres add-on.
- Click the Manage App button.
- Click the Resources tab.
- In the search area in the Add-ons section, type
Heroku Postgres, click Enter. Leave the default Plan Name set to
Hobby Dev - Freeand then click Submit Order Form.
The simplicity and speed of this process hides the complexity of what you just did. With only a few clicks, you provisioned one of 150 add-on services, in this case, a relational database. The service is fully managed, is already running, and is now connected to your application.
Heroku typically connects a provisioned add-on to an application by setting a configuration variable that is available as a runtime environment variable within the application.
- Select the Settings tab.
- In the Config Variables section, click Reveal Config Vars and notice that the
DATABASE_URLis now set.
Now that you have started setting up your Heroku app, in the next step we'll connect it to your Trailhead Playground org.