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.
2. Update nginx.tmpl as described in the "Tune NGINX" section of the code-cloud readme, and follow step 1 of the proxy's own instructions.
3. Start the proxy, using your own email address:
cd proxy/bin
./fresh-start.sh --yes -e your_email@domain --skip-docker-image-check --use-nginx-conf-filesPrepare the folders
Create the folders for your applications and the shared modules, and install Total.js there:
mkdir -p /www/www /www/node_modules
cd /www
npm install total4Install Code
1. Download the official setup:
git clone https://github.com/totaljs/code-cloud
cd code-cloud2. Open docker-compose.yaml and enter your domain in LETSENCRYPT_HOST and VIRTUAL_HOST. You can also set ORIGIN, described in the configuration.
3. Start Code:
docker compose up -d4. 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, for example with a firewall rule that only allows your own address.
Always open Code over HTTPS on a public server.