# Deploy the Etherpad Collaborative Web Editor to App Platform App Platform is a fully managed Platform-as-a-Service (PaaS) that deploys applications from Git repositories or container images. It automatically builds, deploys, and scales components while handling all underlying infrastructure. [Etherpad](https://etherpad.org/) is an open-source web application that enables real-time collaborative text editing in a browser. It’s written in Node.js and can use a variety of databases for its backend storage. This tutorial shows how to deploy the official Etherpad Docker image on [DigitalOcean’s App Platform](https://www.digitalocean.com/products/app-platform/) and connect it to a [PostgreSQL database](https://www.digitalocean.com/products/managed-databases-postgresql/). This tutorial shows how to: 1. Create an app from the Etherpad Docker image on Docker Hub 2. Add environment variables for proxy and database SSL 3. Add a dev PostgreSQL database to the app 4. Choose a region and app name, then create the app 5. Optionally customize Etherpad with environment variables ## Prerequisites This tutorial requires a DigitalOcean account. To create an account, go to the [DigitalOcean account registration page](https://cloud.digitalocean.com/registrations/new). To log in to an existing account, go to the [login page](https://cloud.digitalocean.com/login). ## Step 1: Create a New App on App Platform Go to the [**Create an app** page](https://cloud.digitalocean.com/apps/new) of the DigitalOcean Control Panel. You can also click **App Platform** in the left menu, then **Create App**. On the **Create an app screen**, under **Choose a deployment source**, click the **Container image** tab, then select **Docker Hub** as the source for your application. Enter `etherpad/etherpad` in the **Repository** field and `latest` in the **Tag** field, then click **Next**. ![The Create an app screen showing the Container image tab and Docker Hub selected. The Repository field shows etherpad/etherpad.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/1-choose-source-start.c3da8eb7e5a08cd96e6336cb9babd32bd31bf3a6699139ffaf133e31d9ff3779.png) App Platform analyzes the container image to determine how the application should run. Because the Etherpad image runs a web server, App Platform automatically identifies it as a web service component. When the page updates, the **Resource settings** table displays the component with many configuration settings filled in, such as the resource type, container image, and default port. ## Step 2: Configure the Etherpad App In this step, you add environment variables to the app’s Etherpad component. The environment variables ensure Etherpad works correctly in App Platform by enabling proxy support and allowing a secure connection to the PostgreSQL database you add in the next step. The **Resource settings** table displays configuration settings, some of which the detection system auto-fills. ![The Resource settings table with configuration options for the app.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/3-configure-your-app.166eeaf299b508e1642f8e684a95c307388c7a02819d79388b21662b7bb6c969.png) In the **Environment variables** section, click **Edit**, then add the following **Run time** variables: | Key | Value | Explanation | |---|---|---| | `TRUST_PROXY` | `true` | Sets up correct headers and logging when Etherpad is behind a load balancer or proxy | | `PGSSLMODE` | `no-verify` | Allows Etherpad to connect to databases with self-signed SSL certificates | Review the **Instance size** and **Containers** shown in the **Size** section. Click **Edit** to update these settings if needed. Etherpad’s default installation can operate in a container with 512 MB of RAM. However, adding plugins or supporting higher user traffic may increase memory and CPU requirements. You can change these settings later if needed. ## Step 3: Add a Database In this step, you add a PostgreSQL database to your app. Scroll to the **Add a database** section and click **Create dev database**. ![The Add a database section in the app creation flow.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/configure-your-db.9a6f8f4aa6138e931daf968ba111a471d5d690eaa1624369baf98074b74e2afe.png) After the database is added, click **Edit** in the **Info** section, then enter `db` for the name of the database. This creates a development database called `db`. It is sufficient for light use, and you can upgrade later if needed. App Platform automatically adds the environment variable `DATABASE_URL` to the `etherpad-etherpad` web service component’s configuration. `DATABASE_URL` provides the database connection string that the app uses to connect to the database. ## Step 4: Choose a Region and Finalize Scroll to the **Datacenter region** section, click the **Choose a datacenter region** dropdown menu, then select the region to deploy your app into. The default region is nearest to your current location. To minimize latency, choose the region geographically closest to your users. Scroll to the **Finalize** section. In the **Choose a unique app name** field, enter: ``` etherpad-etherpad ``` When finished, click **Create app**. The app begins to deploy and its progress displays at the top of the page. When complete, the status updates to indicate a successful deployment. You can click your app’s URL at the top of the Overview page. ![The Etherpad app URL.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/5-deployed.6dee46abfa4df6595c341e8b4daab405e8aaac158bdcdf53335cf998c747d7ee.png) Your new Etherpad instance opens in a browser. ![The Etherpad app index page with a 'Open pad by name' button.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/6-etherpad-index.707b05a0794f84c070e4337092ce07790c9343c1c2f98e26a757d4818896053d.png) With that, you have successfully deployed Etherpad on App Platform. The next section covers how to customize Etherpad. ## Step 5: Customizing Etherpad with Environment Variables The official Etherpad Docker image exposes many configuration options via environment variables. The [Etherpad docker image documentation](https://github.com/ether/etherpad-lite/blob/develop/doc/docker.adoc) lists all the available options, including the ability to customize the visual theme and install [Etherpad plugins](https://static.etherpad.org/index.html). To update your environment variables, go to the **Settings** page of your app. Select your Etherpad web service component, then click **Edit** next to **Environment Variables**. Try updating the title of your Etherpad instance by setting a `TITLE` environment variable to a value of your choice: ![Environment variable configuration interface, with a new 'TITLE' variable and 'Sammy's Pad' as the associated value.](https://docs.digitalocean.com/screenshots/app-platform/etherpad-tutorial/7-settings-environment-variables.5784ecf8bdca1c4b6cffb667658172abaaf498f45e1ae614151e6a381b1aee11.png) Click **Save**. The variable is saved and your Etherpad container is redeployed. After reloading Etherpad in your browser, the updated title displays in your browser window. ## Summary In this tutorial you: - Deployed the Etherpad Docker image to App Platform - Created a PostgreSQL database - Created environment variables to configure Etherpad’s database connection - Connected to your live Etherpad instance with your browser - Learned how to further customize Etherpad through environment variables ## What’s Next? Your Etherpad app is ready to use. Optional next steps: - If you want to replace the temporary `https://etherpad-etherpad-2ybz7.ondigitalocean.app/` domain with your own, take a look at our [How to Manage Domains in App Platform](https://docs.digitalocean.com/products/app-platform/how-to/manage-domains/index.html.md) documentation. - To further customize Etherpad, please visit their [Etherpad docker image documentation](https://github.com/ether/etherpad-lite/blob/develop/doc/docker.adoc) to find a list of every configurable environment variable. - To upgrade your database to something more production-ready, see the [Upgrade Dev Database](https://docs.digitalocean.com/products/app-platform/how-to/manage-databases/index.html.md#upgrade-dev-database-to-managed-database) section of our App Platform database documentation. Finally, for more information on Etherpad itself, beyond Docker-specific configuration, please visit the [Etherpad wiki on GitHub](https://github.com/ether/etherpad-lite/wiki).