Skip to content

Local Domain Names Setup

Access your services using friendly domain names instead of localhost:port.

Quick Start

1. Setup Local Domains

Run the setup script to add entries to /etc/hosts:

./scripts/setup-local-domains.sh

This adds: - rawdigs.local → Main app - rabbitmq.rawdigs.local → RabbitMQ Management - vault.rawdigs.local → Vault UI - mail.rawdigs.local → Mailpit - search.rawdigs.local → MeiliSearch - docs.rawdigs.local → Documentation - minio.rawdigs.local → MinIO Console - horizon.rawdigs.local → Horizon Dashboard - traefik.rawdigs.local → Traefik Dashboard

2. Start Services with Traefik

# Using the wrapper script
./scripts/sail-domains up -d

# Or manually
docker compose -f docker-compose.yml -f docker-compose.traefik.yml up -d

3. Access Your Services

Service URL Credentials
Main App http://rawdigs.local -
RabbitMQ http://rabbitmq.rawdigs.local guest/guest
Vault http://vault.rawdigs.local admin/admin-change-me
Mailpit http://mail.rawdigs.local -
MeiliSearch http://search.rawdigs.local -
Documentation http://docs.rawdigs.local -
MinIO Console http://minio.rawdigs.local sail/password
Horizon http://horizon.rawdigs.local -
Traefik Dashboard http://traefik.rawdigs.local:8080 -

How It Works

Traefik Reverse Proxy

Traefik acts as a reverse proxy that: 1. Listens on port 80 (HTTP) 2. Routes requests based on hostname 3. Forwards to the appropriate container

Architecture

Browser Request (rawdigs.local)
    ↓
Traefik (Port 80)
    ↓
Routes to → laravel.test:80

Alternative: Simple /etc/hosts Only

If you don't want Traefik, you can manually add to /etc/hosts:

127.0.0.1  rawdigs.local
127.0.0.1  vault.rawdigs.local

Then access with ports: - http://rawdigs.local (port 80) - http://vault.rawdigs.local:8200

Commands

Start with Traefik

./scripts/sail-domains up -d

Stop

./scripts/sail-domains down

Restart

./scripts/sail-domains restart

View logs

./scripts/sail-domains logs -f

Use regular Sail (no Traefik)

./vendor/bin/sail up -d --no-traefik

Customize Domains

Edit docker-compose.traefik.yml to change domains:

labels:
    - 'traefik.http.routers.rawdigs.rule=Host(`myapp.local`)'

Then add to /etc/hosts:

127.0.0.1  myapp.local

Troubleshooting

Domain not resolving

  1. Check /etc/hosts:

    cat /etc/hosts | grep rawdigs
    

  2. Clear DNS cache:

    sudo dscacheutil -flushcache
    sudo killall -HUP mDNSResponder
    

Traefik not routing

  1. Check Traefik dashboard: http://traefik.rawdigs.local:8080
  2. Verify labels in docker-compose.traefik.yml
  3. Check container logs:
    docker logs traefik
    

Port conflicts

If port 80 is already in use:

  1. Find the process:

    sudo lsof -i :80
    

  2. Stop it or change Traefik port in docker-compose.traefik.yml:

    - '--entrypoints.web.address=:8080'
    

Then access: http://rawdigs.local:8080

Remove Local Domains

To remove entries from /etc/hosts:

sudo sed -i '' '/# RawDigs Local Development/,/# End RawDigs Local Development/d' /etc/hosts

Multi-Project Setup

For multiple projects, use different domain suffixes:

Project 1 (RawDigs): - rawdigs.local - vault.rawdigs.local

Project 2 (OtherApp): - otherapp.local - vault.otherapp.local

Each project gets its own Traefik instance or share one global Traefik.

Production Note

⚠️ Never use .local domains in production! This is for local development only.

For production, use: - Real domain names (rawdigs.com) - Proper SSL/TLS certificates - Production-grade reverse proxy (Nginx, Traefik with Let's Encrypt)