Run Corey on a Hetzner VPS
Run Corey always-on by provisioning a Hetzner VPS, installing Claude Code and the Corey connector, loading secrets via Doppler, and keeping the process alive with a systemd service. Once running, schedule recurring tasks with cron so Corey works for your business around the clock.
Running Corey on a dedicated server means it is available around the clock, can run scheduled tasks while you sleep, and is not tied to your laptop being open. This guide walks through the setup end to end.
Done-for-you setup
Don’t want to run the server yourself? We can provision, configure and manage the VPS for you so Corey is ready out of the box. Get in touch at kristian@pressonetwork.com.
Step 1: Provision a VPS on Hetzner
Hetzner Cloud is a good choice for running Corey: straightforward pricing, solid EU-based infrastructure, and a clean API if you want to automate provisioning later.
TODO: Confirm the recommended Hetzner plan and region with the Corey team before provisioning.
- Create a Hetzner Cloud account if you do not have one.
- Create a new project for your Corey server.
- Click Add Server.
- Location: TODO: Confirm recommended region (e.g. Nuremberg or Helsinki).
- Image: TODO: Confirm the recommended OS image (e.g. Ubuntu 24.04 LTS) and whether a cloud-init script is provided.
- Type: TODO: Confirm the recommended plan (e.g. CPX21 - 3 vCPU, 4 GB RAM).
- Add your SSH public key so you can connect securely.
- Click Create and Buy. Note the server’s IP address once it is running.
Step 2: Install dependencies and Claude Code
Connect to your new server over SSH and install the required software.
ssh root@<your-server-ip> Update the system:
apt update && apt upgrade -y Install Node.js (version 20 or later is required):
# Install Node.js via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
node --version # should print v20.x.x or later Install Claude Code globally:
npm install -g @anthropic-ai/claude-code
claude --version Step 3: Install Doppler and load secrets
Corey uses environment variables for its configuration. On a server, Doppler is the recommended way to manage these safely - secrets live in Doppler, not in shell scripts or .env files on disk.
Install the Doppler CLI:
apt-get install -y apt-transport-https
curl -sLf --retry 3 --tlsv1.2 --proto "=https" \
'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' \
| gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] \
https://packages.doppler.com/public/cli/deb/debian any-version main" \
| tee /etc/apt/sources.list.d/doppler-cli.list
apt-get update && apt-get install doppler Authenticate and configure:
doppler login
doppler setup TODO: Confirm the exact Doppler project name and config name to use during doppler setup. Key names are listed in the project; values are never written to any file on the server.
The key names Corey expects at runtime include:
- TODO: List the required Doppler key names here once confirmed by the Corey team.
Run a quick check to confirm secrets are available:
doppler secrets --only-names Step 4: Run Corey always-on
The launcher mechanic for the CLI is a shell function that changes into your Corey folder and invokes claude with a greeting prompt. On a server you want the same entry point, but managed by the OS so it restarts automatically and starts on boot.
The corey-launcher.sh script (installed by Corey onboarding on desktop) defines the core mechanic:
# The launcher changes into the Corey folder and runs Claude Code.
# On a server this is wrapped in a systemd unit rather than a shell function.
corey() {
cd "$COREY_HOME" || return 1
claude "Greet me as Corey in one line, then run integration_status and tell me what's on my plate."
} TODO: Confirm the always-on mechanism with the Corey team. Options include a systemd service, a tmux session kept alive by cron, or a dedicated process manager. The canonical service definition is being finalised.
The outline for a systemd unit is:
# /etc/systemd/system/corey.service (TODO: confirm and complete this file)
[Unit]
Description=Corey always-on agent
After=network.target
[Service]
Type=simple
User=corey
WorkingDirectory=/home/corey/Corey
EnvironmentFile=/etc/corey/env # TODO: confirm env loading with Doppler
ExecStart=/usr/bin/claude ... # TODO: confirm the exact command
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target Once the unit file is finalised:
systemctl daemon-reload
systemctl enable --now corey
systemctl status corey Step 5: Scheduled tasks and cron
Running Corey always-on handles interactive work. For scheduled tasks - weekly reports, daily digests, invoice reminders - you also need a cron mechanism to trigger Corey at set times.
TODO: Confirm the cron mechanism and an example schedule with the Corey team. The two most likely approaches are:
- A crontab entry that runs a script calling
doppler run -- claude "<task prompt>"at scheduled times. - A dedicated Corey scheduler command (if one exists) that manages task timing internally.
An outline of the crontab approach:
# Example crontab structure (TODO: confirm exact command and schedule)
# Run a weekly report every Monday at 08:00
# 0 8 * * 1 corey doppler run -- claude "Run weekly_report" >> /var/log/corey/cron.log 2>&1 Open questions (for the Corey team)
The following specifics are not yet confirmed and are marked TODO throughout this guide. Once answered, the relevant sections can be updated and the TODOs removed.
- Hetzner plan and region - What is the recommended baseline plan (CPX21? CX22?) and preferred region (Nuremberg? Helsinki?) for running Corey?
- OS image and provisioning - Which OS image should be used (Ubuntu 24.04 LTS?) and is there a cloud-init script or provisioning playbook?
- Doppler project and config names - What are the exact Doppler project name and config name to use during
doppler setup? What Doppler key names does Corey require at runtime on a server? - Always-on mechanism - Is Corey kept alive with a systemd unit, a tmux session, or another process manager? What is the canonical service definition and the exact
ExecStartcommand? - Cron mechanism and example schedule - Is the cron approach a raw crontab, a dedicated Corey command, or something else? What is a good example schedule for a typical recurring task?
- Managed-setup product - What is the price point and scope of the done-for-you managed setup (so the call-out above can name it once the product is defined)?