---
title: Install on a server
project: Code
version: 2.0
section: guides
language: en
license: MIT
url: https://totaljs.es/docs/code/2-0/guides/install-server/
updated: 2026-11-19T04:32:04.377Z
---

# Install on a server

> Run Total.js Code on a server with Docker and HTTPS.

This installation runs Code in Docker on a server, behind a proxy that handles your domains and HTTPS certificates.

## Before you start

- Point the DNS of your domains to the server.
- Install Docker and Node.js on the server.

## Set up the proxy

**1.** Clone [nginx-proxy-automation](https://github.com/evertramos/nginx-proxy-automation).

**2.** Update `nginx.tmpl` as described in the "Tune NGINX" section of the [code-cloud readme](https://github.com/totaljs/code-cloud), and follow step 1 of the proxy's own instructions.

**3.** Start the proxy, using your own email address:

```bash
cd proxy/bin
./fresh-start.sh --yes -e your_email@domain --skip-docker-image-check --use-nginx-conf-files
```

## Prepare the folders

Create the folders for your applications and the shared modules, and install Total.js there:

```bash
mkdir -p /www/www /www/node_modules
cd /www
npm install total4
```

## Install Code

**1.** Download the official setup:

```bash
git clone https://github.com/totaljs/code-cloud
cd code-cloud
```

**2.** Open `docker-compose.yaml` and enter your domain in `LETSENCRYPT_HOST` and `VIRTUAL_HOST`. You can also set `ORIGIN`, described in the [configuration](../../reference/configuration/).

**3.** Start Code:

```bash
docker compose up -d
```

**4.** Open your domain in the browser.

## Protect your server

The first person who opens a fresh instance becomes its administrator. Keep the server closed to the public until you have [created the first administrator](../first-administrator/), for example with a firewall rule that only allows your own address.

Always open Code over HTTPS on a public server.
