---
title: "Deployment and Updates"
description: "Deployment and Updates"
type: "docs"
category: "doc"
tags: []
authors: [Anonymous]
date: "2026-10-10"
last_update: "2026-10-10"
time_minutes: 2
draft: false
unlisted: false
url: "https://www.derafu.dev/docs/core/website-skeleton/deployment"
---

# Deployment and Updates

## Deploy a website to production

All these instructions are executed in the Docker container.

### Add website to configuration file

If you created the site from scratch instead of cloning it, make sure the website is added to the `$DEPLOYER_DIR/sites.php` file. You can validate this by running:

```shell
site-add www.example.com git@github.com:example/example.git
```

**Note**: If the site requires special configuration, you'll need to manually edit the `$DEPLOYER_DIR/sites.php` file.

### Style tests, code quality, and unit tests

Run style tests, code quality, and unit tests in the Docker container with:

```shell
site www.example.com
site-check
```

### Push changes to GitHub

If everything is correct, push the changes to GitHub:

```shell
site www.example.com
site-send "Website update."
```

**Note**: If the GitHub repository has a [configured webhook](https://www.derafu.dev/docs/sysadmin/github), the website will be deployed automatically when pushing changes and passing the style tests, code quality, and unit tests in the GitHub Actions workflow.

### Deployment

> [!INFO]
>
>It's not necessary to deploy to the production server if the GitHub repository has a [configured webhook](https://www.derafu.dev/docs/sysadmin/github){.alert-link}.

If there are no errors, you can deploy to the production server with:

```shell
#DEPLOYER_HOST=hosting.example.com # Only if not configured in .env
site-deploy www.example.com
```

If an error occurs when deploying and you try to make a new deploy, it's very likely that the deploy is locked. If this happens, you can unlock and deploy again with:

```shell
#DEPLOYER_HOST=hosting.example.com # Only if not configured in .env
site-deploy-locked www.example.com
```

## Update components

### Update Docker

On your local machine, run:

```shell
DEV_DIR=$HOME/dev
DOCKER_DIR=$DEV_DIR/docker-sites-php
cd $DOCKER_DIR
git pull
docker-compose build --no-cache
docker-compose up -d
```

> [!WARNING]
>
>You must add the SSH keys to the Docker container again and configure Git inside the container.

### Update PHP Deployer

Enter the container and run:

```shell
cd $DEPLOYER_DIR
git pull
composer update
```

### Update website

Enter the container and run:

```shell
site www.example.com
site-update
```



---
Last updated on 10/10/2026

