FAQ & Troubleshooting¶
Common questions and solutions for speedtest-cli.
General Questions¶
What is speedtest-cli?¶
speedtest-cli is a command-line tool for testing your internet connection speed. It uses Cloudflare's global network infrastructure to measure download/upload speeds, latency, jitter, and other network metrics.
How accurate is speedtest-cli?¶
speedtest-cli provides accurate measurements when:
- You're connected via Ethernet (Wi-Fi adds variability)
- No other applications are using bandwidth
- Tests are run to nearby Cloudflare servers
- Adequate test file sizes are used
Results may vary slightly from other speed test tools due to different testing methodologies and server locations.
Which servers does speedtest-cli use?¶
speedtest-cli uses Cloudflare's global network (speed.cloudflare.com). It automatically connects to the nearest Cloudflare edge server for optimal performance.
Can I choose a specific server?¶
Currently, speedtest-cli automatically selects the nearest Cloudflare server. Manual server selection is not supported, but it's on the roadmap for future releases.
Is my data private?¶
Yes. speedtest-cli:
- ✅ Uses HTTPS for all connections
- ✅ Doesn't collect personal information
- ✅ Doesn't store browsing history
- ✅ Is open source (auditable)
- ✅ Doesn't send telemetry to developers
The only data transmitted is: - Test data to/from Cloudflare - Your IP address (necessary for routing)
Is speedtest-cli free?¶
Yes, speedtest-cli is completely free and open source under the MIT License.
Does it work offline?¶
No, speedtest-cli requires an active internet connection to test your speed.
Installation Issues¶
Command Not Found After Installation¶
Problem: speedtest-cli: command not found
Solutions:
- Ensure installation path is in PATH:
```bash # For pipx pipx ensurepath
# Restart terminal or reload shell source ~/.bashrc # or ~/.zshrc ```
- Verify installation:
bash
pipx list # or uv tool list
- Reinstall:
bash
pipx uninstall speedtest-cloudflare-cli
pipx install speedtest-cloudflare-cli
- Use full path:
bash
~/.local/bin/speedtest-cli
Permission Denied During Installation¶
Problem: Permission errors with pip
Solutions:
- Use pipx or uv instead (recommended):
bash
pipx install speedtest-cloudflare-cli
- Install for current user only:
bash
pip install --user speedtest-cloudflare-cli
- Don't use sudo with pip (can break system packages)
Python Version Incompatibility¶
Problem: Requires Python 3.9+
Solutions:
- Check Python version:
bash
python --version
- Install compatible Python:
```bash # Ubuntu/Debian sudo apt install python3.12
# macOS brew install python@3.12 ```
- Use pyenv for multiple Python versions:
bash
pyenv install 3.12
pyenv global 3.12
Package Not Found on PyPI¶
Problem: Could not find a version that satisfies the requirement
Solution:
Ensure correct package name:
# ✅ Correct
pip install speedtest-cloudflare-cli
# ❌ Wrong
pip install speedtest-cli # Different package!
Usage Issues¶
Tests Are Very Slow¶
Problem: Speed tests take too long to complete
Possible Causes & Solutions:
- Large test files on slow connection:
bash
# Use smaller file sizes
speedtest-cli -ds 10 -us 5
- Network congestion:
- Test during off-peak hours
-
Close bandwidth-heavy applications
-
Wi-Fi interference:
- Switch to Ethernet
- Move closer to router
-
Test on 5GHz band if available
-
System resources:
- Close unnecessary applications
- Check CPU/memory usage
Ping/Latency Test Fails¶
Problem: Ping test failed or very high latency
Solutions:
- ICMP may be blocked:
speedtest-cli automatically falls back to HTTP latency measurement. This is normal and expected in many environments.
- Grant ICMP permissions (Linux):
bash
# Not recommended for security reasons
sudo setcap cap_net_raw+ep $(which python3)
- Use HTTP latency instead:
HTTP latency is displayed automatically and is sufficient for most use cases.
- Check firewall:
- Ensure outbound HTTPS is allowed
- Check for corporate firewall rules
Connection Timeout Errors¶
Problem: Connection timeout or Network unreachable
Solutions:
- Check internet connection:
bash
ping 1.1.1.1
curl https://speed.cloudflare.com
- Check proxy settings:
speedtest-cli respects system proxy settings. Ensure they're correct.
- Disable VPN temporarily:
Some VPNs may interfere with speed tests.
- Check firewall:
Allow outbound HTTPS connections to *.cloudflare.com
- Try different network:
Test on different Wi-Fi or Ethernet connection.
Results Differ from Other Speed Tests¶
Problem: Different results compared to Ookla, Fast.com, etc.
Explanation:
This is normal and expected because:
- Different servers: speedtest-cli uses Cloudflare, others use different networks
- Different methodologies: Varying test algorithms
- Different times: Network conditions change
- Different locations: Server distances vary
Tips for Consistency:
- Run multiple tests:
bash
speedtest-cli --attempts 5
- Test at same time of day
- Use same connection type (Wi-Fi vs Ethernet)
- Close background applications
Web Dashboard Won't Open¶
Problem: --web_view doesn't open browser
Solutions:
- Manually open HTML file:
```bash # Linux/macOS find /tmp -name "speedtest_dashboard*.html" -exec firefox {} \;
# macOS open "$(find /tmp -name 'speedtest_dashboard*.html' | head -1)" ```
- Check default browser:
Ensure you have a default browser configured.
- Permissions:
Check that /tmp is writable:
bash
ls -ld /tmp
- Try different browser:
bash
# Specify browser
BROWSER=chromium speedtest-cli --web_view
JSON Output Not Working¶
Problem: --json produces no output or errors
Solutions:
- Check for syntax errors:
bash
speedtest-cli --json | jq .
- Redirect errors:
bash
speedtest-cli --json 2>&1 | tee output.log
- Check file permissions:
bash
speedtest-cli --json-output results.json
ls -l results.json
Performance Issues¶
Slower Speeds Than Expected¶
Problem: Test results slower than ISP advertised speeds
Troubleshooting Steps:
- Use Ethernet connection:
Wi-Fi typically slower than wired.
- Test at different times:
Network congestion varies throughout day.
- Close bandwidth-heavy apps:
- Stop downloads/uploads
- Pause cloud sync (Dropbox, Google Drive)
- Close streaming services
-
Disable auto-updates
-
Restart router/modem:
Power cycle your network equipment.
- Check for ISP issues:
Contact ISP if consistently slow.
- Test on different devices:
Isolate whether issue is device-specific.
- Check system resources:
bash
top # or htop
- Disable QoS:
Quality of Service settings may limit speed.
High Jitter Values¶
Problem: Jitter is high (> 30ms)
Causes & Solutions:
- Wi-Fi interference:
- Switch to Ethernet
- Change Wi-Fi channel
-
Move closer to router
-
Network congestion:
- Test during off-peak hours
-
Close bandwidth-heavy applications
-
ISP issues:
- Contact ISP if persistent
-
Check for service outages
-
Router issues:
- Restart router
- Update router firmware
- Replace old router
High Ping Latency¶
Problem: Ping is high (> 100ms)
Possible Causes:
- Geographic distance to server:
- Normal if far from Cloudflare edge
-
Check with
metadata.colo -
Network routing:
- ISP routing inefficiency
-
Use traceroute to diagnose
-
VPN/Proxy:
- Adds latency
-
Test without VPN
-
Wi-Fi:
- Switch to Ethernet
- Reduce interference
Docker/Container Issues¶
Cannot Pull Docker Image¶
Problem: Error response from daemon: pull access denied
Solutions:
- Use correct image name:
bash
docker pull ghcr.io/takitsu21/speedtest:latest
- Check network connectivity:
bash
ping ghcr.io
- Retry pull:
bash
docker pull --quiet ghcr.io/takitsu21/speedtest:latest
Container Doesn't Show Output¶
Problem: Docker container runs but no output
Solutions:
- Use -it flags:
bash
docker run --rm -it ghcr.io/takitsu21/speedtest:latest
- Check logs:
bash
docker logs <container-id>
- Run with shell:
bash
docker run --rm -it ghcr.io/takitsu21/speedtest:latest sh
speedtest-cli
Docker Permission Denied (Linux)¶
Problem: permission denied while trying to connect to Docker daemon
Solutions:
- Add user to docker group:
bash
sudo usermod -aG docker $USER
newgrp docker
- Use Podman (rootless):
bash
podman run --rm -it ghcr.io/takitsu21/speedtest:latest
- Use sudo (not recommended):
bash
sudo docker run --rm -it ghcr.io/takitsu21/speedtest:latest
API/Library Usage Issues¶
Import Errors¶
Problem: ModuleNotFoundError: No module named 'speedtest_cloudflare_cli'
Solutions:
- Verify installation:
bash
pip list | grep speedtest
- Install package:
bash
pip install speedtest-cloudflare-cli
- Check Python path:
python
import sys
print(sys.path)
- Use virtual environment:
bash
python -m venv venv
source venv/bin/activate
pip install speedtest-cloudflare-cli
Type Checking Errors¶
Problem: mypy shows type errors
Solution:
Install type stubs if needed:
pip install types-httpx
The library includes type hints, so most IDEs will have proper autocomplete.
Platform-Specific Issues¶
Windows Issues¶
Problem: Various Windows-specific issues
Solutions:
- Use Windows Terminal:
Download from Microsoft Store for best experience.
- PowerShell encoding:
powershell
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
- Path issues:
Add Python Scripts directory to PATH:
C:\Users\YourName\AppData\Local\Programs\Python\Python312\Scripts
- ICMP permissions:
Usually available by default on Windows.
macOS Issues¶
Problem: macOS-specific issues
Solutions:
- System Integrity Protection:
No special configuration needed.
- Homebrew Python:
Use pipx or uv to avoid conflicts.
- Terminal permissions:
Grant Terminal full disk access in System Preferences if needed.
Linux Issues¶
Problem: Linux-specific issues
Solutions:
- ICMP permissions:
bash
# Grant capabilities (optional)
sudo setcap cap_net_raw+ep $(which python3)
- Snap/Flatpak isolation:
Use native installation instead.
- SELinux:
May need to adjust policies in rare cases.
Comparing with Other Tools¶
vs. Ookla Speedtest¶
Differences:
- Backend: Cloudflare vs Ookla servers
- Open Source: Yes vs No
- CLI-first: Yes vs GUI-first
- Privacy: High vs Medium
When to use speedtest-cli: - Command-line workflows - Automation/scripting - Privacy concerns - Cloudflare infrastructure testing
When to use Ookla: - Need server selection - Prefer GUI - ISP uses Ookla for official tests
vs. Fast.com¶
Differences:
- Backend: Cloudflare vs Netflix CDN
- CLI: Native vs Web-only
- Metrics: Comprehensive vs Basic
- Automation: Easy vs Difficult
When to use speedtest-cli: - More detailed metrics needed - CLI automation required - JSON output needed
When to use Fast.com: - Quick browser test - Netflix streaming quality
Getting More Help¶
Check Documentation¶
- Installation Guide - Setup help
- Usage Guide - CLI options
- Features - Capabilities
- API Reference - Library usage
Report Issues¶
If you've found a bug:
- Check existing issues
- Create a new issue with:
- OS and Python version
- speedtest-cli version
- Steps to reproduce
- Error messages
- Expected vs actual behavior
Ask Questions¶
- GitHub Discussions - Ask questions
- GitHub Issues - Report bugs
Enable Debug Output¶
For troubleshooting, run with verbose Python logging:
python -m speedtest_cloudflare_cli.main --help
Common Error Messages¶
"Network error: Could not connect to speed.cloudflare.com"¶
Cause: Cannot reach Cloudflare servers
Solution:
1. Check internet connection
2. Check firewall settings
3. Try with VPN disabled
4. Verify DNS resolution: nslookup speed.cloudflare.com
"Permission denied: Cannot create file"¶
Cause: No write permissions for output file
Solution:
# Check permissions
ls -la /path/to/output/
# Use writable location
speedtest-cli --json-output ~/results.json
"ModuleNotFoundError"¶
Cause: Package not installed or wrong environment
Solution:
# Verify installation
pip show speedtest-cloudflare-cli
# Reinstall
pip install --force-reinstall speedtest-cloudflare-cli
"Command 'speedtest-cli' not found"¶
Cause: Installation path not in PATH
Solution: See Command Not Found above.
Tips for Best Results¶
Optimize Test Accuracy¶
- Use Ethernet instead of Wi-Fi
- Close all applications using bandwidth
- Run multiple tests with
--attempts 3 - Test at different times to see variance
- Restart router before important tests
Automation Best Practices¶
- Use silent mode in scripts
- Export to JSON for parsing
- Don't test too frequently (respect bandwidth)
- Handle errors gracefully in scripts
- Log results for historical tracking
Performance Tuning¶
- Adjust test sizes based on connection speed
- Use download-only for quick tests
- Enable silent mode to reduce overhead
- Run from containers for isolation
Still have questions? Open a discussion on GitHub!