# Background Tasks (Local)

Ready SaaS ships with a mechanism for your app to run tasks in the background. Using [Celery](https://docs.celeryq.dev/en/stable/) and [Redis](https://redis.io/), your project can handle tasks such as sending emails in the background.

The cool thing is that creating a new task to run in the background is super easy thanks to having all the setup already included in the project.

In order to run the background tasks, you need to follow these steps:

### 1. Install Redis and Start the Redis Server

Install redis with the following command:

```
brew install redis
```

Now run the redis server with this command:

```
redis-server
```

### 2. Start the background processes

Celery is used to run background tasks such as sending emails, processing payments, and more.

Run the following commands ***in separate terminal windows*** to start the Celery worker and beat processes.

```
python -m celery -A config worker -l info
python -m celery -A config beat -l info
```

If you you followed all the steps above successfully, you should see something like this in your terminal when running the celery worker:

<figure><img src="/files/upiykLlKuZdRKlW7VWNm" alt=""><figcaption></figcaption></figure>

***Yay! Your local background setup is all set*** :tada:


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://readysaas.gitbook.io/docs/guides/background-tasks-local.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
