The logo Orion Docs
Environments

Generic

The Generic environment

Environment

The Generic environment is a lightweight Linux environment, ideal for running binaries from compiled languages such as C, C++, Rust, Go, Zig, etc.

How it works

The start.bash file is executed at startup. You can modify it to do whatever you want: execution, compilation, Git synchronization, etc.

Examples

C

gcc is installed by default.

start.bash
#!/bin/bash

echo "Compiling..."
gcc main.c -o main

echo "Running app"
./main

C++

g++ is installed by default.

start.bash
#!/bin/bash

echo "Compiling..."
g++ main.cpp -o main

echo "Running app"
./main

Rust

Rust is not installed by default. As it consumes a large amount of memory during compilation, it is recommended to compile locally and use Orion CLI to deploy your code.

Locally:

cargo build --release --target x86_64-unknown-linux-musl

# move the binary outside /target/ so the CLI can deploy it
# (change "app-name" by your binary name)
mv target/x86_64-unknown-linux-musl/release/app-name app-name

In the server:

start.bash
#!/bin/bash

chmod +x ./app-name
./app-name

Go

Go is not installed by default. You can either compile locally and then deploy the binary, or install Go on the server.

  1. Recommended: deploy via Orion CLI
start.bash
#!/bin/bash

chmod +x ./main
./main
  1. This script installs Go on first launch (this takes a few minutes). As compilation is quite slow, this is not recommended.
start.bash
#!/bin/bash

GO_VERSION=1.26.3

if [ ! -f /home/container/.go/bin/go ]; then
    echo "Installing Go..."
    wget https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz -O /tmp/go.tar.gz
    mkdir -p /home/container/.go
    tar -C /home/container/.go --strip-components=1 -xzf /tmp/go.tar.gz
    rm /tmp/go.tar.gz
    echo "Go installed!"
fi

export PATH=/home/container/.go/bin:$PATH

go version

echo "Compiling..."
go build main.go

echo "Running app"
./main

Zig

Zig is not installed by default. It is recommended to compile locally and use Orion CLI to deploy your code.

Locally:

zig build-exe main.zig -O ReleaseFast
# or static if needed:
zig build-exe main.zig -target x86_64-linux-musl -O ReleaseFast

In the server:

start.bash
#!/bin/bash

chmod +x ./main
./main

Other languages

For other languages, simply deploy the final binary to the server and execute it. Orion CLI is recommended for deployment.

In the server:

start.bash
#!/bin/bash

chmod +x ./binaryfile
./binaryfile

On this page