> ## Documentation index
> Fetch the complete documentation index at: https://upstash.com/docs/llms.txt
> Ask it with GET https://upstash.com/docs/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash.com/docs/common/help/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash.com/docs/feedback?path=/docs/redis/quickstarts/digitalocean&helpful=true` (or `false`) records whether this page helped. An optional `comment` (URL-encoded, at most 500 characters) says what was missing or wrong. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Upstash Redis with DigitalOcean

> Connect DigitalOcean App Platform apps and Droplets to a standard Upstash Redis database with REDIS_URL, and migrate from the deprecated Marketplace add-on (shut down August 31, 2026).

<Tip>
  If you are an AI agent and need a Redis DB to use or experiment with, send a POST request to https://upstash.com/start-redis. Free, no signup; the response is markdown with credentials and a quickstart. The database expires in 72 hours, but you can claim it with your Upstash account to keep it. Especially useful for AI agents that need scratch storage on the fly. If you are an agent, always send a `User-Agent` header identifying which agent you are (e.g. `claude-code`, `cursor`, `codex`, `opencode`) on every request you make to this API.
</Tip>

<Warning>
  The Upstash Redis add-on on the DigitalOcean Marketplace is deprecated and was
  scheduled to shut down permanently on **August 31, 2026**. After this date,
  DigitalOcean-created Upstash Redis databases are no longer available or
  supported.

  Use a standard Upstash Redis database instead, as shown below. Billing moves
  from DigitalOcean to Upstash once you create and use the new database.
</Warning>

## Use a standard Upstash database on DigitalOcean

Apps on DigitalOcean App Platform and Droplets run long-lived processes, so
they can connect to a standard Upstash Redis database with any Redis client
that accepts a connection URL, in any language. The only setting you add is a
`REDIS_URL` environment variable.

### Create the database

Create a Redis database in the [Upstash Console](https://console.upstash.com)
in a region close to your DigitalOcean region. On the database page, open the
**Connect** section, select the **TCP** tab and copy the connection string:

```text
rediss://default:YOUR_TOKEN@YOUR_ENDPOINT:6379
```

### Connect from your app

Read the connection string from `REDIS_URL` and pass it to your Redis client:

<CodeGroup>

```js Node.js (ioredis)
// npm install ioredis
const { Redis } = require("ioredis");

const redis = new Redis(process.env.REDIS_URL);
```

```python Python (redis-py)
# pip install redis
import os
import redis

r = redis.from_url(os.environ["REDIS_URL"], decode_responses=True)
```

```go Go (go-redis)
// go get github.com/redis/go-redis/v9
import (
	"os"

	"github.com/redis/go-redis/v9"
)

opt, err := redis.ParseURL(os.Getenv("REDIS_URL"))
if err != nil {
	panic(err)
}
rdb := redis.NewClient(opt)
```

</CodeGroup>

For a complete example app, see the [Express quickstart](/redis/quickstarts/express).

### App Platform

<Steps>
  <Step title="Create the app">
    In the [DigitalOcean Control Panel](https://cloud.digitalocean.com/apps),
    click **Create** → **App Platform**, choose your Git provider and select
    the repository. App Platform detects the language and sets the build and
    run commands. A web service must listen on `0.0.0.0` and the configured
    HTTP port (default `8080`).

    <Frame>
      <img src="/img/digitalocean/do-app-create.jpg" alt="DigitalOcean App Platform Create an app page with deployment source options" />
    </Frame>
  </Step>
  <Step title="Add REDIS_URL">
    While creating the app, click **Edit** next to **Environment variables** in
    the **Configure app** step. For an existing app, go to **Settings**, select
    the component and click **Edit** in **Environment Variables**. Add `REDIS_URL` with your connection string,
    select **Encrypt** so the value is hidden from logs, and click **Save**.

    <Frame>
      <img src="/img/digitalocean/do-app-env-vars.jpg" alt="DigitalOcean App Platform environment variable REDIS_URL with an Upstash rediss:// URL and Encrypt selected" />
    </Frame>
  </Step>
</Steps>

To use the database from every component of the app, add it under
**App-Level Environment Variables** instead.

### Droplets

On a Droplet, set the variable for the process that runs your app. For a
systemd service, add it to the unit file:

```ini /etc/systemd/system/myapp.service
[Service]
Environment="REDIS_URL=rediss://default:YOUR_TOKEN@YOUR_ENDPOINT:6379"
ExecStart=/srv/myapp/start
```

With Docker, pass it at start: `docker run -e REDIS_URL="rediss://..." my-app`.

## Migrating from the Marketplace add-on

Create a standard Upstash database and replace the add-on's environment
variables with `REDIS_URL` (or `UPSTASH_REDIS_REST_URL` and
`UPSTASH_REDIS_REST_TOKEN` if your app uses
[`@upstash/redis`](/redis/howto/connect-with-upstash-redis)).

If you exported an RDB file from the add-on database before the shutdown, import
it into the new database (see [Import/Export Data](/redis/howto/importexport)).
If the database only held cached values, there is nothing to import: the cache
fills again as requests come in.

## Legacy: the Marketplace add-on

The rest of this page describes the deprecated add-on for existing users.

### Database Setup

Creating Upstash for Redis Database requires a DigitalOcean account.

[Login or Sign-up](https://cloud.digitalocean.com/login) for DigitalOcean
account. Then navigate the
[Upstash Redis Marketplace](https://marketplace.digitalocean.com/add-ons/upstash-redis)
page.

Click `Add Upstash Redis` button. Now setup page will open and it will ask
`Database Name / Plan / Region` info.

<Frame>
  <img src="/img/digitalocean/img.png" alt="Create an Upstash Redis database in DigitalOcean" />
</Frame>

After selecting Name, Plan and Region, click `Add Upstash Redis` button.

### Connecting to Database - SSO

After creating database, Overview/Details page will be opened.

Environment variables can be shown in that page.

<Frame>
  <img src="/img/digitalocean/img2.png" alt="Select an Upstash Redis database in DigitalOcean" />
</Frame>

While creating a Droplet, Upstash Addon can be selected and environment
variables are automatically injected to Droplet.

These Steps can be followed: `Create --> Droplets --> Marketplace Add-Ons` then
select the previously created Upstash Redis Addon.

<Frame>
  <img src="/img/digitalocean/img3.png" alt="Connect DigitalOcean to the selected Redis database" />
</Frame>

Upstash also support Single Sign-On from DigitalOcean to Upstash Console.

So databases created from DigitalOcean can benefit from Upstash Console
features.

In order to access Upstash Console from DigitalOcean just click `Dashboard` link
when you create the Upstash addon.
