You are reading the documentation for an outdated Corteza release. 2023.9 is the latest stable Corteza release.

Local Corteza demo setup with in-memory database and automation server

The section covers configuration files that are only suitable for a demo on a local environment. All services are on the same network, ports are bound to the host’s network, etc. We’re using a minimum setup with corredor automation server, no persistent storage using in-memory SQLite3.

Restarting server gives you a fresh database, and you’ll lose all your records, users and uploaded files.

This is not an optimal setup for a production environment.

Configurations

docker-compose.yaml
version: '3.5'

services:
  server:
    image: cortezaproject/corteza-server:2020.12
    restart: on-failure
    depends_on: [ corredor ]
    # Direct your browser to http://localhost:18080
    ports: [ "127.0.0.1:18080:80" ]
    environment:
      # Enable webapps
      HTTP_WEBAPP_ENABLED: "true"
      # Disable action log to minimize db writes
      ACTIONLOG_ENABLED: "false"

  corredor:
    image: cortezaproject/corteza-server-corredor:2020.12
    restart: on-failure

Create an empty directory with the docker-compose.yaml file. You can adjust the provided example configuration files as you see fit.

Run the services

docker-compose up -d

Run this command in the same directory as your docker-compose.yaml file. It will start all services based on the configurations provided in the configuration files.

You can check if everything is running correctly, by executing the docker-compose ps command. The output should be similar to this one:

       Name                      Command                  State                Ports
---------------------------------------------------------------------------------------------
demo_mem_corredor_1   /corredor/node_modules/.bi ...   Up (healthy)   80/tcp
demo_mem_server_1     bin/server serve-api             Up (healthy)   127.0.0.1:18080->80/tcp

You can see 2 services up and running. On a modern machine Corteza initializes and configures itself in under 10 seconds.

Testing the demo

  1. Direct your browser to http://localhost:18080. If you used other ports in your configurations, use those. On your first visit, you should be redirected to the authentication page (/auth),

  2. create your account through the sign-up form.

  3. check the server version http://localhost:18080/version

  4. check the server’s health http://localhost:18080/healthcheck

  5. check the API documentation http://localhost:18080/api/docs/

The first user gets automatically promoted to an administrator. You can add additional users by using the sign-up form or by adding them in the administration panel.

With disabled email capabilities (unconfigured SMTP_* options) all email sending is offline and with it, email confirmation on sign-up.

Troubleshooting

Ports are not available

In case something else on your machine is using ports configured ports you will see error like this:

Cannot start service server: Ports are not available: listen tcp 127.0.0.1:18080: bind: address already in use

You can safely change the port to any number between 1024 and 65535. You can also replace value for services.server.ports in docker-compose.yaml to [ "80" ] and docker will pick an available port for you.

Connection to Corredor

You might see one or more connection refused errors in server container logs (docker-compose logs -f server):

{"level":"error","ts":1608125024.4714684,"logger":"corredor","caller":"corredor/service.go:427","msg":"could not load corredor server scripts","error":"rpc error: code = DeadlineExceeded desc = latest balancer error: connection error: desc = \"transport: Error while dialing dial tcp 172.23.0.2:80: connect: connection refused\"","stacktrace":"github.com/cortezaproject/corteza-server/pkg/corredor.(*service).loadServerScripts\n\t/drone/src/pkg/corredor/service.go:427"}----

If there are a couple of errors when server is starting up that’s ok. Sometimes it takes more time to start up Corredor server and Corteza server can not yet connect to it.

If problem persists, and you can see Corredor state as healthy please verify changes you might have made to the configuration.

Network proxy declared as external

ERROR: Network proxy declared as external, but could not be found. Please create the network manually using `docker network create proxy` and try again.

Make sure your nginx-proxy service is up and running before running Corteza.

Further troubleshooting

If you’re continuing to have issues with Corteza, we encourage you to make contact with other users on our community server. You’ll more than likely find someone who can help you out. You can also open an issue on our cortezaproject/corteza-server GitHub repository.