# Application portability

Source: https://docs.apphaven.eu/portability

An application on AppHaven is built from standard components: a Git
repository, a Dockerfile, OCI containers, PostgreSQL, persistent files, and
environment variables. None of them are AppHaven-specific, so an app can run
elsewhere, on another platform or your own server, without being rewritten.
This page lists where each part lives and how to take it with you.

## Code

Your application source lives in **your Git repository**, on your own Git
host. AppHaven reads it to build and deploy; it never holds the only copy.
Disconnecting is a matter of revoking the access token or uninstalling the
GitHub App.

## Container images

AppHaven builds your app with your own `Dockerfile` using a standard
`docker build`. There is no AppHaven base image, no injected build step, and
no proprietary SDK, so the same repository produces the same image on your
laptop, in your own CI, or on any other container platform.

## The manifest

`apphaven.yaml` is a declarative file in your repository. Its vocabulary,
services, images, ports, environment, volumes, healthchecks, and start order,
is the common vocabulary of container tooling, and it maps directly onto a
Docker Compose file: a `container` service becomes a Compose service, a
`postgres` service becomes a `postgres:17` container with a volume, and
`depends_on` and `healthcheck` carry over almost unchanged. Recreating the
same setup with Compose on a single server is mechanical.

## Database

A managed database is **standard PostgreSQL** (version 17), with no forks,
proprietary extensions, or AppHaven-specific schema. It exports with the
standard tools: `pg_dump` produces a portable dump that restores into any
PostgreSQL, whether another managed offering, a container, or a bare server.

Your services already hold the connection details through
[connection references](https://docs.apphaven.eu/services/postgres.md#connection-references), so a dump
can be produced from inside your app's environment, for example by an admin
endpoint, a one-off service in your manifest, or your app's own export
feature, and written to a volume or shipped wherever you choose. AppHaven
support can also produce a full export of your data on request.

## Files

Files on [persistent volumes](https://docs.apphaven.eu/volumes.md) are ordinary files your app reads and
writes. Export them the way your app already accesses them: an export
endpoint, a sync job to object storage, or the support-assisted export above.

## Configuration

- The manifest (services, volumes, and `env` defaults) is already in your
  repository.
- **Variables** set in the console are readable there at any time, so copying
  them out is a settings page away.
- **Secrets** are [write-only by design](https://docs.apphaven.eu/security.md#secrets): AppHaven does not
  display a secret's value after it is saved, to anyone. Keep the canonical
  copy of each secret in your own password manager or secret store, so it is
  available independently of AppHaven.

## Summary

| Part | How to take it elsewhere |
| ---- | ------------------------ |
| Code | Already in your Git repository |
| Images | `docker build` from your own Dockerfile |
| App definition | `apphaven.yaml` maps onto Docker Compose |
| Database | Standard PostgreSQL: `pg_dump` / `pg_restore` |
| Files | Ordinary files on volumes; export via your app or support |
| Variables | Readable in the console |
| Secrets | From your own password manager or secret store |

## Where to go next

- [How AppHaven runs your app](https://docs.apphaven.eu/how-it-works.md): the platform in context.
- [Backups & recovery](https://docs.apphaven.eu/backups.md): how your data is protected while it runs here.
