Skip to main content

Setup

Configure your local development environment to get started developing with Temporal.

Install Python

Make sure you have Python installed. These tutorials use Python 3.10. Check your version of Python with the following command:

You'll see the version printed to the screen.

python3 -V
python 3.10.9

Install the Temporal Python SDK

You should install the Temporal Python SDK in your project using a virtual environment. Create a directory for your Temporal project, switch to the new directory, create a Python virtual environment, activate it, and then install the Temporal SDK.

You'll see an output similar to the following:

Next, you'll configure a local Temporal Service for development.

mkdir temporal-project
cd temporal-project
python3 -m venv env
source env/bin/activate
python -m pip install temporalio
Successfully installed temporalio-x.y

Install Temporal CLI

The fastest way to get a development version of the Temporal Service running on your local machine is to use Temporal CLI.

Install Temporal CLI on your local machine using the following instructions for your platform.

brew install temporal

Start the development server

Once you've installed Temporal CLI and added it to your PATH, open a new Terminal window and run the following command.

This command starts a local Temporal Service. It starts the Web UI, creates the default Namespaces, and uses an in-memory database.

The Temporal Service will be available on localhost:7233. The Temporal Web UI will be available at http://localhost:8233.

Leave the local Temporal Service running as you work through tutorials and other projects. You can stop the Temporal Service at any time by pressing CTRL+C.

The temporal server start-dev command uses an in-memory database, so stopping the server will erase all your Workflows and all your Task Queues. If you want to retain those between runs, start the server and specify a database filename using the --db-filename option, like this:

temporal server start-dev

Change the Web UI port

The Temporal Web UI may be on a different port in some examples or tutorials. To change the port for the Web UI, use the --ui-port option when starting the server:

temporal server start-dev --ui-port 8080

The Temporal Web UI will now be available at http://localhost:8080.

temporal server start-dev --db-filename your_temporal.db

Next: Run your first Temporal Application

Learn how to create a basic Workflow and run it with the Temporal Python SDK