Created
January 25, 2026 06:18
-
-
Save slaveofcode/451b7cd861828d71d3f2699290faf942 to your computer and use it in GitHub Desktop.
Setup Postgres (18), Redis, Redpanda (Kafka) and Redis Console (Kafka UI) via Podman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # give access via: chmod +x ./dev-down.sh | |
| # execute via ./dev-down.sh | |
| echo "π Stopping and removing containers..." | |
| podman stop local-postgres local-redis local-redpanda redpanda-console | |
| podman rm local-postgres local-redis local-redpanda redpanda-console | |
| echo "β¨ Done. Data is still safe in $HOME/podman_data" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # don't forget to create the dir first. for example: mkdir -p ~/Podman/podman_data | |
| # put this file at ~/Podman/dev-up.sh | |
| # give access via: chmod +x ./dev-up.sh | |
| # execute via ./dev-up.sh | |
| # Configuration: Specific directories for data | |
| DATA_ROOT="$HOME/Podman/podman_data" | |
| POSTGRES_DIR="$DATA_ROOT/postgres" | |
| REDIS_DIR="$DATA_ROOT/redis" | |
| REDPANDA_DIR="$DATA_ROOT/redpanda" | |
| # Create directories if they don't exist | |
| mkdir -p "$POSTGRES_DIR" "$REDIS_DIR" "$REDPANDA_DIR" | |
| echo "π Starting local dev environment..." | |
| # 1. PostgreSQL 18 | |
| podman run -d \ | |
| --name local-postgres \ | |
| -e POSTGRES_PASSWORD=mamamia \ | |
| -p 5432:5432 \ | |
| -v "$POSTGRES_DIR":/var/lib/postgresql:Z \ | |
| docker.io/library/postgres:latest | |
| # 2. Redis | |
| podman rm -f local-redis 2>/dev/null | |
| podman run -d \ | |
| --name local-redis \ | |
| -p 6379:6379 \ | |
| -v "$REDIS_DIR":/data:Z \ | |
| redis redis-server --save 60 1 | |
| # 3. Redpanda | |
| podman rm -f local-redpanda 2>/dev/null | |
| podman run -d \ | |
| --name local-redpanda \ | |
| -p 9092:9092 -p 9644:9644 \ | |
| -v "$REDPANDA_DIR":/var/lib/redpanda/data:Z \ | |
| docker.io/redpandadata/redpanda:latest \ | |
| redpanda start \ | |
| --mode dev-container \ | |
| --smp 1 \ | |
| --memory 1G \ | |
| --kafka-addr PLAINTEXT://0.0.0.0:9092 \ | |
| --advertise-kafka-addr PLAINTEXT://localhost:9092 | |
| # 4. Redpanda Console (Web UI) | |
| podman rm -f redpanda-console 2>/dev/null | |
| podman run -d \ | |
| --name redpanda-console \ | |
| -p 8080:8080 \ | |
| -e KAFKA_BROKERS=host.containers.internal:9092 \ | |
| docker.io/redpandadata/console:latest | |
| echo "β All services are up!" | |
| podman ps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment