> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shipways.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding a site

> What the form asks, and what happens the moment you save.

A site is always added to a server, and only to one that hosts sites —
[application or web](/servers/types).

The site starts serving a holding page straight away. You can add the
repository now or later, and **nothing is deployed until you ask for it**.

## Domain

The primary hostname. Other names it should answer on are
[aliases](/sites/domains#aliases), added afterwards.

The domain is also the name of the site's directory on the machine, of its
nginx file, and of its log files, so it is worth getting right the first time.

## What it is

The [site kind](/sites/kinds) — Laravel, WordPress, a static build, something
proxied to a port. It picks the web directory and the routing, and both stay
changeable afterwards.

A proxied kind asks for a **port**. Node frameworks default to 3000; a plain
proxied site could be anything, so it asks.

## Repository and branch

Optional at this stage.

If you have [connected a source control account](/source-control), you can pick
a repository from a list and Shipways installs the site's
[deploy key](/sites/deployments#the-deploy-key) for you.

Otherwise type an address. A bare `owner/repository` means GitHub; paste a full
SSH or HTTPS URL for anything else, and add the deploy key to the repository
yourself.

## Root and web directory

**Root directory** is where the application lives inside the repository. Deploy
scripts run here, and it is where `composer.json` and `artisan` are looked for.
`/` for an ordinary repository, `/apps/api` for one directory of a monorepo.

**Web directory** is what nginx serves, relative to the root directory. The
kind fills it in — `/public` for Laravel and Symfony, `/` for most of the rest.

They hang together: an application in `apps/api` served from `/public` is
served from `apps/api/public`.

## PHP version

Only asked for when the kind runs PHP. The choices are the versions
[installed on that server](/servers/php).

## Connecting a database

Optional, and worth doing here rather than later.

**Create a new database** makes one on the server, plus an account for this
site with a password Shipways generates. The credentials are written straight
into the site's environment file on the first deploy, so there is nothing to
copy across.

**Use an existing one** points this site at a database another site already
uses. Both read and write the same data, but this one connects as its own
account, so it can be shut out later without touching the other.

<Note>
  The environment file is seeded once, on the first deploy, and never touched
  again. That is the only moment Shipways can fill in a working `DB_` block —
  attach a database afterwards and you will be
  [editing the environment file](/sites/environment) yourself.
</Note>

## What happens on save

The directories and the nginx file are created, and the site serves a holding
page. That page is recorded as a deployment called `initial`, which means the
site always has something to fall back to if a first real deploy fails its
health check.
