Set Up Space Cloud
The first step to start using Space Cloud is setting it up. Space Cloud requires several components to be running for proper functions. The most important components are:
- Gateway: Responsible for ingress traffic and generation of REST / GaphQL APIs.
- Runner: Responsible for intracluster traffic and policy enforcement.
- Container Registry: Responsible for storing docker images.
Luckily, we don’t have to interact with these components in most use cases directly because Space Cloud ships with a utility named
space-cli that bootstraps a cluster for us.
- Make sure you have Docker installed.
Installing Space CLI
The first step is downloading
space-cli. You can download a version for your particular platform:
Unzip the compressed archive.
For Linux / Mac:
unzip space-cli.zip && chmod +x space-cli
For Windows: Right-click on the archive and select
To make sure if the
space-cli binary is correct, type the following command from the directory where you have downloaded
For Linux / Mac:
This prints the
space-cli binary to your environment path variable for global usage.
For Linux / Mac: Copy the
usr/local/bin. You may have to use
sudo depending on the permissions of your
For Windows: Add the path of the
space-cli.exe to the environment variable
PATH for making
space-cli accessible globally.
Setting up Space Cloud
We can set up all Space Cloud components using a single command.
space-cli setup --dev
setup command selects
Docker as a target by default and runs all the containers required to setup Space Cloud. On successful installation it generates an output similar to this one:
INFO Setting up Space Cloud on docker. INFO Fetching latest Space Cloud Version INFO Starting container space-cloud-gateway... INFO Image spaceuptech/gateway:latest already exists. No need to pull it again INFO Starting container space-cloud-runner... INFO Image spaceuptech/runner:latest already exists. No need to pull it again INFO Space Cloud (id: "local-admin") has been successfully setup! 👍 INFO You can visit mission control at http://localhost:4122/mission-control 💻 INFO Your login credentials: [username: "local-admin"; key: "KkYr6FvgYsvr"] 🤫
Verify the installation run the following docker command:
docker ps --filter=name=space-cloud
You should see an output similar to this!
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 507ce4042486 spaceuptech/runner:latest "./app start" About a minute ago Up About a minute space-cloud-runner 33a5a7a9be3a spaceuptech/gateway:latest "./app run" About a minute ago Up About a minute 0.0.0.0:4122->4122/tcp, 0.0.0.0:4126->4126/tcp space-cloud-gateway
You can use the
space-cli startcommand to restart these containers if they are stopped manually or by the reboot process of your machine.
Creating your first project
Now that we have got Space Cloud setup, we can open
Mission Control (Space cloud’s admin UI) on http://localhost:4122/mission-control.
A screen like this greets you:
Hit on the
CREATE A PROJECT button to open the following page:
Enter a project name. You can stick to
MyProject for this one.
Create Project button.
Mission Control now asks for setting up a database:
If you already have one, feel free to configure it. For now, we’ll skip this step since we don’t have a database running at this point.
You can destroy the Space Cloud cluster along with all the deployments by running the
Great! We have successfully set up a Space Cloud on Docker and created our first project with it.
Continue to the next guide to add a database to our newly created project and perform some queries on it.