# Installing a Coreapp

> Install an app from its repository, keep it up to date, go back to an older version, or remove it.

- Web page: https://documentation.federated.computer/hosting/coreapps/installing-a-coreapp/

You install a Coreapp from its git repository, such as `https://gitea.example.com/my-team/timesheets`. The Core reads the app's `coreapp.toml` and icon from the repository, pulls its published image, and sets up what it needs. Nothing else from the repository runs on your Core.

## Before you install

- **Trust the publisher.** A Coreapp gets the Core's sign-in, a database, and an email account, and people will put their work into it. Install apps from people or projects you trust.
- **Private apps need a token.** If the repository or its image is private, give your Core a token first. See [Private Coreapps](https://documentation.federated.computer/hosting/coreapps/private-coreapps/).
- **Check the name is free.** An app can't use the name of one of Federated's applications (installed or not) or one of the Core's own addresses, such as `mail` or `www`. If it does, the developer has to rename it.

## Install an app

> **You host only**
>
> Run these as root on the Core.
>
> Command-line access is available only when Federated Core was installed with the You host option. [What this means](https://documentation.federated.computer/getting-started/command-line-access/)

1. See what installing would do, without changing anything:

   ```
   coreapps plan https://gitea.example.com/my-team/timesheets
   ```

   It shows the app's name and version, the release tag and commit it would install, its image, what it needs from the Core (`postgres`, `mysql`, `sso`, `email`), and its address, for example `https://timesheets.example.com/`.

2. Install it:

   ```
   coreapps install https://gitea.example.com/my-team/timesheets
   ```

   Without a tag, it installs the newest release (the highest `v1.2.3`-style tag). To install a particular release, add it to the address: `https://gitea.example.com/my-team/timesheets@v1.2.0`.

3. When it finishes, it prints the app's address. The app appears in your dashboard and in Superpanel.

> **Add-on apps**
>
> On tiers other than Enterprise, a Coreapp is recorded as an add-on application. `coreapps install` stops and says so first; add `--addon-ok` to go ahead.

## Who can sign in

If the app signs in with Core accounts (it needs `sso`), anyone with an account on your Core can sign in with **Core SSO**, without an invitation:

- The Core's admin account (`admin@example.com`) is always an admin of the app. It signs in only through Core SSO; nobody can claim that role by signing up inside the app.
- Everyone else starts with the app's lowest role, usually read-only. The app's admins give people more access inside the app.

## Update an app

```
coreapps update timesheets
```

This installs the newest release from the repository the app came from. Its settings, data, and database are kept.

Before updating, the Core keeps a copy of the app's settings, its database, and its files. If the new version doesn't start, the update is rolled back automatically and the app runs as it did before. The Core checks there's room on its disk for the database's copy first, and leaves the app alone if there isn't.

> **Releases can't change under you**
>
> The Core remembers the exact image it installed for each release. If a publisher pushes a different image under the same version, the Core refuses it: a fix has to come as a new version.

## Go back to an older version

Installing an older release than the one installed is refused, because the older version may not understand what the newer one left in its database and files. If you're sure, add `--downgrade`:

```
coreapps install --downgrade https://gitea.example.com/my-team/timesheets@v1.1.0
```

> **Be careful**
>
> Going back keeps the app's current data. Check with the app's publisher that the older version can read it. If it doesn't start, the Core rolls back to the version you had.

## See what's installed

```
coreapps list
```

lists the Coreapps on the Core: each one's version, whether it's running, and the repository and release it was installed from.

## Remove an app

```
coreapps remove timesheets
```

> **Be careful**
>
> Removing an app deletes its data and its database, and removes its sign-in and email accounts. Export anything you want to keep from inside the app first.
