---
title: "Run your k6 test locally | Grafana Labs"
description: "Execute your k6 test script locally and view the results in your terminal."
---

> For a curated documentation index, see [llms.txt](/llms.txt). For the complete documentation index, see [llms-full.txt](/llms-full.txt).

# Run your k6 test locally

Run the script on your machine and read the terminal summary.

This is the first concrete win in the path: k6 executes the `default` function, collects metrics, and prints results without requiring cloud infrastructure.

To run your k6 test locally, complete the following steps:

1. Open your terminal and navigate to the directory containing your `script.js` file.
2. Run the k6 test using the following command:
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   k6 run script.js
   ```
   
   If you’re using Docker instead of a native installation, run the command from the directory that contains `script.js` (the `<` passes the script into the container):
   
   Bash ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```bash
   docker run --rm -i grafana/k6 run - < script.js
   ```
3. Observe the test execution in your terminal. k6 displays progress information, including:
   
   - Current iteration count
   - HTTP request statistics
   - Response time metrics
   - Data transfer information
   - Any errors or failures
4. Review the test summary when the test completes. Look for:
   
   - Total test duration
   - Number of iterations completed
   - HTTP request statistics (total requests, successful requests, failed requests)
   - Response time metrics (average, minimum, maximum, p90, p95 — where p95 means 95% of requests were faster than this value)
   - Data transfer metrics (data sent, data received)
   - Checks and thresholds status (if configured)
   
   You should see output similar to:
   
   text ![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy
   
   ```text
   TOTAL RESULTS
   
    checks_total.......................: 10      13.122179/s
    checks_succeeded...................: 100.00% 10 out of 10
    checks_failed......................: 0.00%   0 out of 10
   
    ✓ status was 200
   
    HTTP
    http_req_duration..............: avg=123.45ms min=98.12ms med=120.00ms max=156.78ms
   ```

p(90)=148ms p(95)=150ms http\_req\_failed…………….: 0.00% 0 out of 10 http\_reqs………………….: 10 1.67/s

```
EXECUTION
iteration_duration.............: avg=1.12s min=1.10s med=1.11s max=1.15s p(90)=1.14s
```

p(95)=1.14s iterations…………………: 10 1.67/s

```
NETWORK
data_received..................: 15 kB  2.5 kB/s
data_sent......................: 1.0 kB 168 B/s
```

If the test fails to run or you encounter errors, check that your script syntax is correct and that you have network connectivity to the target URL. For more help, refer to the [k6 documentation on running tests](/docs/k6/latest/get-started/running-k6/).

In the next milestone, you’ll send these test results to Grafana Cloud to visualize them in dashboards and analyze performance trends over time.
