# Go: listen tcp :8080: bind: address already in use

**Code:** `listen tcp :8080: bind: address already in use` · **Category:** Go · **Seen on:** Go, Linux

The port your Go server wants is already taken by another process (or a previous instance of your app).

## Meaning

Find the process with `lsof -i :8080` or `ss -ltnp`, stop it, or choose another port (read from `PORT`). A crashed dev server or `go run` child process can stay alive. In containers ensure only one process binds the port.

## Common causes

- Previous instance still running
- Another service on the same port
- go run left a child process
- Port published twice in Docker
- Hot-reload tool starting two copies

## Quick fix

1. `lsof -i :8080` then `kill <pid>`
2. Use a different port via env `PORT`
3. Check Docker/compose port mappings

## Detailed fix by platform

### Linux

1. `ss -ltnp | grep :8080` or `lsof -i :8080`

## How to diagnose

1. **Owner** — Which PID?
2. **Port** — Configurable?
3. **Docker** — Duplicate mapping?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/go/address-already-in-use)
