---
name: ark-cloud
description: Get a project ready to run on Ark Cloud (arkcloud.online) and tell its owner how to put it online. Use when the user wants to deploy or host an app on Ark Cloud, or asks about ark.toml or Ark's databases, buckets, functions or phone simulator.
---

# Get a project ready for Ark Cloud

Ark Cloud builds an app from a Git repository (with Railpack, or the
repository's Dockerfile), runs it, and gives it an address like
`shop.arkcloud.site`. Databases, buckets and other services sit next to it in
the same project.

Ark has no command-line tool or public API yet, so you can't put the app
online yourself. Your job is to get the code ready, check it, and then tell
the user exactly what to do in Ark's dashboard.

## 1. Read Ark's docs

Fetch `https://arkcloud.online/llms.txt`: Ark's docs as Markdown. Go by what it
says. Don't guess how Ark works from other hosts.

## 2. Look at the project

Find out, without changing anything:

- Its language and framework, and how it builds and starts.
- Whether it has a `Dockerfile`, a `compose.yaml`, a `wrangler.toml` or an
  `ark.toml`.
- Whether the repository holds more than one app, and in which folders.
- What it needs to run: a database, Redis, file storage, email, payments, SMS.
- Where it reads its settings, and any secrets written in the code.

## 3. Make it ready

Tell the user what you'd change and why, and wait for their yes before you
edit. Keep the project's own stack: don't move it to another language,
framework or database to suit Ark. Ark runs what they have.

- **Port.** Ark sets `PORT` (8080 unless the user changes it). A web app must
  listen on `0.0.0.0` and that port. An app that listens on `localhost` won't
  answer. If it can only listen on a fixed port, set `port` in `ark.toml` to
  it; Ark sets `PORT` to the same.
- **Settings from variables.** Read every setting and secret from environment
  variables. Never commit a secret; list the ones the user must add in
  **Variables**. Apps built from code also get their variables while they
  build.
- **Services Ark connects.** When the user links a service to the app, the app
  gets these variables:
  - Postgres: `DATABASE_URL`. MySQL: `MYSQL_URL`. MariaDB: `MARIADB_URL`.
  - MongoDB: `MONGO_URL`. Redis and Valkey: `REDIS_URL`.
  - A bucket: `BUCKET`, `AWS_ENDPOINT_URL`, `AWS_REGION`,
    `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`. Use path-style addresses
    (`forcePathStyle` in JavaScript).

  If the code expects other names, read these or map them. Another service's
  variable can also be set by hand, like `DATABASE_URL=${{postgres.DATABASE_URL}}`.
- **Files.** Keep uploads in a bucket. Files an app writes to its own folder
  are gone when a new version goes out.
- **Migrations.** `ark.toml` has no separate release step: run migrations when
  the app starts, or in its start command.
- **Sleep.** A project sleeps after 10 minutes without a visit and wakes on the
  next one. Something that must keep running with no visitors (a queue worker,
  a bot, a timer) needs `sleep = false` in `ark.toml`.
- **Payments, SMS, USSD, calls, email.** Ark's phone simulator answers like MTN
  MoMo, Airtel Money, Pindo, Africa's Talking and SMTP, and gives the app
  variables like `MOMO_BASE_URL`, `PINDO_TOKEN`, `AT_API_KEY` and `SMTP_HOST`.
  Write the code against the provider's real API, reading those variables, so
  it works in production with real keys. The docs list every variable.
- **Functions.** A Workers-style handler (`export default { fetch }`) can run as
  a function. Cloudflare's KV, D1, R2, Durable Objects and Queues aren't there;
  use a database or bucket instead.

### ark.toml

Add an `ark.toml` in the app's folder only when Ark can't work things out by
itself: a start command it can't guess, a fixed port, a Dockerfile
in a subfolder, or a build command. These are the only keys; any other key, or
a wrong value, stops the build:

```toml
[build]
builder    = "dockerfile"         # or "railpack"
dockerfile = "docker/Dockerfile"  # implies builder = "dockerfile"
target     = "runtime"            # the Dockerfile's stage
command    = "npm run build"      # Railpack's build command, without a Dockerfile

[deploy]
start = "node server.js"
port  = 8080
sleep = false                     # stay on while nobody visits
```

While the file is there, its settings win over the dashboard's.

## 4. Check it

Build and start the app the way Ark would, with `PORT=8080` and the variables
it needs, and open it. If a Dockerfile is there, build it. Fix what fails
before you hand over.

## 5. Hand over

Tell the user, in short steps:

1. Push the code to GitHub (or another Git host).
2. At https://arkcloud.online, sign in and choose **New project**. Connect
   GitHub and pick the repository, and the app's folder if there are several.
   With a `compose.yaml`, Ark shows what it would make before making it.
3. Choose **Add** for each service the app needs, then drag a line from the app
   to it. The app gets its variables and restarts.
4. Add the variables you listed in **Variables**.
5. If they want their own domain: the app's **Settings**, then **Domains**.

When the app needs a service, name what Ark's catalog offers for it and let the
user choose. Don't pick one for them.

If a build fails, ask the user to paste the log from **Deployments**. An
`ark.toml` mistake shows its line, like `ark.toml line 6: port must be a whole number`.
