Temporal Dev Server on FreeBSD

Temporal Dev Server on FreeBSD

At Conrad Research we LOVE Temporal. It gives us a high velocity in development because our code doesn't have to worry as much about implementing retry logic. We are in the process of moving to a self-hosted Temporal server and as such we're starting with the baby step of setting up a Temporal CLI dev server to run on our FeeBSD deployment platform.

Here are the simple steps to getting up and running with a Temporal CLI dev server on FreeBSD:

Prerequisites

  • Git installed
  • Go installed

Steps

1. Clone the Temporal CLI repository.

git clone [email protected]:temporalio/cli.git

2. Build the Temporal CLI.

This will build a binary named 'temporal' in the 'cli' directory.

cd cli
go build ./cmd/temporal

3. Run the Temporal CLI dev server.

Copy the binary to a location in your PATH. I recommend using the typical FreeBSD '/usr/local/bin' directory.

# Note: You may need to copy using root privileges depending on your system configuration.
cp temporal /usr/local/bin/

Confirm that the binary is in your PATH.

which temporal

Confirm that the binary is working.

temporal --version

Start the Temporal CLI dev server.

temporal server start-dev

4. Configure Temporal CLI dev server.

To persist the dev server across reboots, create a '~/temporal-db' folder. Then when you start the dev server, point it to the database file using the '--db-filename' flag.

mkdir ~/temporal-db
temporal server start-dev --db-filename ~/temporal-db/dev.db

At Conrad Research we use the HTTP API so that our Cloudflare Workers can interact with Temporal. To make sure the Temporal CLI dev server starts the HTTP API, add the '--http-port 7243' flag.

temporal server start-dev --http-port 7243

We also use Cloudflare Zero Trust to control our access to our Temporal CLI dev server. To make sure we can reach the server via it's Cloudflare WARP address provide the '--ip 0.0.0.0' flag. This will make it accessible from anywhere.

temporal server start-dev --ip 0.0.0.0

Conclusion

If you need all of the above features you can use the following command:

temporal server start-dev --db-filename ~/temporal-db/dev.db --http-port 7243 --ip 0.0.0.0 &

Couple reminders:

  • Don't use the dev server in production. This is for development only.
  • You'll need to start the dev server after each server reboot.

Now you're ready to start developing with Temporal on FreeBSD!

Cheers 🥂

More Articles