# Installing and Running n8n — AI Automation with n8n

Source: https://www.geekswithgeeks.com/en/n8n-ai-automation/basics-install

> Start n8n locally with Docker or npx and open the editor.

## Two quick ways to start

The fastest local start is Docker. Mount a volume so your workflows and credentials survive restarts. An alternative is `npx n8n` if you have Node.js installed. Either way the editor opens at `http://localhost:5678`, where you create an owner account on first run.

## Run with Docker

The named volume `n8n_data` stores your data in `/home/node/.n8n`. Check the official docs for the current image tag and flags.

```bash
docker volume create n8n_data
docker run -it --rm --name n8n -p 5678:5678 \
  -v n8n_data:/home/node/.n8n \
  docker.n8n.io/n8nio/n8n

# or, with Node.js installed:
npx n8n
```

## Do not skip the volume

Without a persistent volume, removing the container deletes every workflow and the encryption key, and saved credentials become unrecoverable. Back the volume up.

**Quiz:** Why mount a volume when running n8n in Docker?

- [x] So data survives container restarts and removal
- [ ] To make n8n faster
- [ ] To open more ports
- [ ] Docker requires it to start

*Answer:* So data survives container restarts and removal. Workflows, credentials and settings live in the data folder, which must be persisted.
