How to deploy a Laravel for Rust app on Cloider App Engine
Deploy a Laravel for Rust app with PostgreSQL on Cloider App Engine three ways: from the dashboard with a Dockerfile and a GitHub repository, with the cloider CLI, or with one prompt to an AI coding agent, with a screenshot of every step.

On this page
Key takeaways
- A Dockerfile builds the Vite frontend and the Rust binary, and ships a small Debian runtime on port 8080.
- The app reaches PostgreSQL on the database's private host with sslmode=require.
- APP_KEY and DATABASE_URL are locked secrets, never shown in the dashboard again.
- Run ./myapp migrate --force once, from the app Terminal or cloider app exec.
- With the CLI it is cloider login, then cloider deploy.
Laravel for Rust brings Laravel's routing, validation, Eloquent-style models, migrations and Inertia frontends to Rust, and builds your app into a single fast binary. In this guide you deploy a real Laravel for Rust app with a PostgreSQL database to Cloider App Engine (Apps in the dashboard), three ways:
From the dashboard: dockerize the app, create the database, connect the GitHub repository, then add the environment variables and secrets.
With the cloider CLI: install it,
cloider login,cloider deploy.With an AI coding agent: one prompt, "using cloider cli deploy this app".
Options 1 and 2 show every step with a screenshot of what you will see. The finished app is live at laravel-rust-blog.cloider.app, and the code is on GitHub at mareimorsy/laravel-rust-blog.
What you are deploying
The app is the Laravel for Rust starter with a small blog on top: a list of posts, and pages to write, edit and delete them. It uses an Inertia + React + TypeScript + Tailwind frontend, keeps its posts, sessions, cache and jobs in PostgreSQL, and reads its configuration from environment variables.
Variable | Value on Cloider | Secret |
|---|---|---|
APP_ENV | production | No |
APP_DEBUG | false | No |
APP_URL | https://<your-subdomain>.cloider.app | No |
APP_KEY | base64: followed by 32 random bytes in base64 | Yes |
DATABASE_URL | postgres://USER:PASSWORD@HOST:PORT/DB?sslmode=require | Yes |
Clone it to follow along:
git clone https://github.com/mareimorsy/laravel-rust-blog.git
cd laravel-rust-blogYou also need a Cloider account. New accounts get a welcome credit, which covers everything in this guide many times over.
Option 1: deploy from the Cloider dashboard
Step 1: Dockerize the app
Cloider builds an app with buildpacks when it has no Dockerfile, and with your Dockerfile when it has one. A Laravel for Rust app needs both Node.js (for the frontend) and Rust (for the server) at build time, so a Dockerfile is the clearest way to build it.
Laravel for Rust compiles your whole application, migrations included, into one binary. At runtime it still reads three folders next to it: public/ (the Vite build), resources/views/ (the root view) and storage/. The Dockerfile in the repository builds all of that in three stages:
assets:
npm ciandnpm run buildwrite the Inertia + React frontend topublic/build.server:
cargo build --release --lockedbuilds the binary. The two cache mounts keep the Cargo registry and the build folder between builds, so a rebuild only compiles what changed.runtime: a slim Debian image with the binary,
public/,resources/views/and a writablestorage/, running as a non-rootappuser.
# syntax=docker/dockerfile:1
FROM node:24-slim AS assets
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY vite.config.ts tsconfig.json ./
COPY resources ./resources
COPY public ./public
RUN npm run build
FROM rust:1.100-slim-trixie AS server
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/build \
cargo build --release --locked \
&& cp target/release/myapp /usr/local/bin/myapp
FROM debian:trixie-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
&& useradd --system --no-create-home app
WORKDIR /app
COPY --from=server /usr/local/bin/myapp ./myapp
COPY --from=assets /app/public ./public
COPY resources/views ./resources/views
RUN mkdir -p storage/app storage/logs && chown -R app:app storage
ENV SERVER_HOST=0.0.0.0 \
SERVER_PORT=8080
USER app
EXPOSE 8080
CMD ["./myapp"]
Two settings matter on any platform. The server listens on 127.0.0.1:8000 by default, which nothing outside the container can reach, so the image sets SERVER_HOST=0.0.0.0 and SERVER_PORT=8080. And Cloider terminates HTTPS in front of your app, so src/app.rs trusts the proxy, which makes the URLs the app generates start with https://:
.with_middleware(|middleware, _| {
// Cloider's load balancer terminates HTTPS, and apps are only reachable through it
middleware.trust_proxies(["*"]);
// ...
})The framework also answers GET /up with a 200 once it has started, which is what Cloider and Kubernetes use as the health check.
Step 2: Create the PostgreSQL database
Open Databases in the sidebar and click Create Database. Name it laravel, set the user to laravel, and pick PostgreSQL v18 as the engine.

Leave Trusted sources on Allow Everything and SSL Mode on, and keep the Hobby plan, which is plenty for this app. Then click Create database.

The database shows Creating for a minute or two, then Ready.

Click it to see its connection details. Your app runs on Cloider, so it connects through the private host (...db.cloider.internal), which stays inside Cloider's network. Open the Private tab under Quick Connect and copy the DSN, then click show next to the password to fill it in.


Step 3: Connect the GitHub repository (or upload the code)
Open Apps and click Create App. You can import a Git repository from GitHub, GitLab or Bitbucket, deploy a Docker image you already built, or drag and drop the project folder or a zip file to upload it.

Click GitHub. The first time, GitHub asks you to install the Cloider Apps GitHub App and choose the repositories it may read. Pick laravel-rust-blog, and keep the main branch. Every push to that branch deploys a new version.

Click Import. Cloider reads the repository and fills in the form: the app name, the type (Web service) and port 8080. Pick a free subdomain, here laravel-rust-blog.cloider.app.

If you would rather not connect Git, the upload area does the same with a folder or a zip of the project. Leave out target/ and node_modules/: they are large, and the Dockerfile builds them anyway.
Step 4: Add the environment variables and secrets
Under Environment variables, click Add variable for each plain setting:

Then add the two secrets, and click the lock icon next to each so its value is never shown in the dashboard again:
DATABASE_URL: the private DSN from step 2, with the password in it, for examplepostgres://laravel:PASSWORD@laravel-42lble.db.cloider.internal:20149/laravel?sslmode=require.APP_KEY: the key that encrypts sessions and cookies. Make one with the command below, and keep it the same across deploys.
echo "base64:$(openssl rand -base64 32)"
Open Advanced settings and set the Health check path to /up. A new version then only goes live once it answers there, and a replica that stops answering is restarted.

Click Create App. Cloider starts a build machine, builds the image from your Dockerfile and streams the output. The first build compiles every crate, so it takes several minutes. Later builds reuse the build cache.


Step 5: Run the migrations
The app is up, but the database is still empty, so /posts answers with a 500 (relation "posts" does not exist in the logs). Open the app's Terminal tab, which gives you a shell in a running replica, and run the migrations once:
./myapp migrate --force
Run them the same way after any deploy that adds a migration. Run them from one place only: the framework doesn't lock the migrations table, and the app runs at least two replicas.
Step 6: Open the app
Open https://laravel-rust-blog.cloider.app, click New post and publish one. It goes through the app, into PostgreSQL and back:


From now on, git push to main is a deploy: Cloider builds the new commit and switches to it once its health check passes.
Option 2: deploy with the cloider CLI
The same deployment from your terminal, in three commands plus the database.
Step 1: Install the CLI
curl -fsSL https://cloider.com/install.sh | sh
On Windows, run irm https://cloider.com/install.ps1 | iex in PowerShell instead.
Step 2: cloider login
cloider loginThe CLI opens your browser on Cloider, where you pick the account and whether the CLI may make changes:



Step 3: Create the database
cloider db create blog-db --engine postgresql --wait
Build the connection string for the private host, and a new app key, into shell variables. Nothing secret is printed:
DB=$(cloider db get blog-db -o json)
export DATABASE_URL="postgres://$(jq -r .database_user <<<$DB):$(cloider db password blog-db)@$(jq -r .private_host <<<$DB):$(jq -r .database_port <<<$DB)/$(jq -r .database_name <<<$DB)?sslmode=require"
export APP_KEY="base64:$(openssl rand -base64 32)"Step 4: cloider deploy
From the project folder, deploy it. The first deploy creates the app, and later ones from the same folder update it:
cloider deploy --name laravel-rust-cli --subdomain laravel-rust-cli \
--env APP_ENV=production --env APP_DEBUG=false \
--env APP_URL=https://laravel-rust-cli.cloider.app \
--secret-env APP_KEY="$APP_KEY" --secret-env DATABASE_URL="$DATABASE_URL"The CLI zips the folder (leaving out what .gitignore lists), creates the app, links the folder to it in .cloider/app.json, and streams the build:


Then run the migrations in the app's container with cloider app exec:
cloider app exec laravel-rust-cli -- ./myapp migrate --force
To deploy a new version later, run cloider deploy again in the same folder.
Option 3: let an AI coding agent deploy it
If you work with an AI coding agent such as Claude Code, Cursor or Codex, install and log in to the CLI as in option 2, open the project, and ask:
using cloider cli deploy this appThe first thing cloider --help prints is a note for AI agents pointing them to docs.cloider.com/llms.txt, which holds the deployment strategy agents follow on Cloider:
Start with
cloider whoami, to confirm the account and that the token can make changes.Deploy a web service like this one as an app, and use a managed database instead of running PostgreSQL yourself.
When the project has a GitHub, GitLab or Bitbucket remote, ask you to run
cloider git connectand create the app from the repository, so every push deploys. That is the one step the agent can't finish for you.Use Kubernetes only when you ask for it or the app needs it.
Agents can also drive Cloider through its MCP server, cloider mcp, with the same commands as tools. See AI coding agents in the docs.
Troubleshooting
500 on every page, with
relation "posts" does not existin the logs: the migrations haven't run. Run./myapp migrate --forcein the app's Terminal, or withcloider app exec.400 Bad Request: in production the app only answers requests for its
APP_URLhost. Check thatAPP_URLmatches the subdomain or domain you open it on.Errors about TLS or SSL when connecting to the database: keep
?sslmode=requireat the end ofDATABASE_URL. SSL is on for new databases.Sessions reset after a deploy:
APP_KEYchanged. Generate it once and keep it as a locked secret.
What it costs
An app is billed for the CPU and memory its replicas use, with a minimum of $2.99 per 30 days while it runs. The Hobby PostgreSQL plan is $3.99 a month. Both are charged by the hour, so trying this out for an afternoon costs cents, and the welcome credit of a new account covers it. Delete the app and the database from their pages when you're done.
Frequently asked questions
Does Cloider support Laravel for Rust?
Yes. Cloider builds the app from its Dockerfile, runs it on two or more replicas behind HTTPS, and gives it a managed PostgreSQL database. The guide deploys a real Laravel for Rust app this way.
How do I run Laravel for Rust migrations on Cloider?
The migrations are compiled into the binary. Run ./myapp migrate --force once from the app's Terminal tab in the dashboard, or with cloider app exec <app> -- ./myapp migrate --force.
Which database host should a Cloider app use?
The private host, which ends in .db.cloider.internal. It stays inside Cloider's network. Keep sslmode=require in the connection string.
Can I deploy without connecting GitHub?
Yes. Upload the project folder or a zip in the dashboard, or run cloider deploy from the folder.

Comments