Install Gophish Phishing Framework on Kali Linux

Deepak Prasad
Tested on Kali GNU/Linux Rolling 2026.2 (kali-rolling)
Package gophish 0.12.1
golang-go 2:1.26~1
unzip 6.0-29
Applies to Kali Linux
Lab environment Isolated Kali VM or host-only network — pentest lab setup
Privilege Normal user for download and config; root or sudo when phish_server uses port 80
Scope Download and install Gophish from the official release, edit config.json, first start, admin login, and a short console map. Does not cover SMTP profiles, landing pages, or launching campaigns.

Gophish bundles phishing email delivery, landing pages, and campaign reporting in one admin console. This walkthrough installs the current upstream release on Kali, adjusts config.json for a typical lab where Apache already listens on port 80, and captures the first-run admin password from the terminal.

IMPORTANT
Run Gophish only for authorized phishing simulations on systems and mail domains you own or are explicitly allowed to test. Use an isolated lab network. Do not point campaigns at employees, customers, or third parties without written permission.

What is Gophish in ethical hacking?

Gophish is an open-source phishing framework aimed at security teams and penetration testers who run authorized social-engineering exercises. You manage campaigns from a web admin UI while a separate phishing listener serves cloned landing pages and tracks opens, clicks, and submitted credentials.

In an ethical hacking lab, Gophish replaces a pile of manual steps: one console holds user groups, email templates, landing pages, SMTP sending profiles, and per-recipient results. The binary is written in Go; upstream ships pre-built ZIP files for Linux amd64 so you do not need to compile for a standard Kali install.

This article stops at a working admin login. For sending profiles, templates, and launching a campaign, continue with create phishing campaign with Gophish.


Compare Gophish install methods

Method Best for Notes
Pre-built release ZIP Most Kali labs and production-style installs Download gophish-vX.Y.Z-linux-64bit.zip from GitHub releases, unzip, run ./gophish
Build from source Developers patching Gophish or tracking master Requires Go 1.19+ and git clone; run go build in the repo root
apt on Kali Quick package install Not available in default Kali repos; use the ZIP or source build

The steps below use the pre-built ZIP because it matches what most readers need and what we exercised on Kali Rolling 2026.2.


Kali lab setup

Set two variables so download URLs stay versioned and repeatable. I install under ~/gophish so the framework lives outside the git repo.

bash
export GOPHISH_VERSION="0.12.1"
export GOPHISH_DIR="${HOME}/gophish"
mkdir -p "${GOPHISH_DIR}"

Confirm unzip is available. Kali images usually include it; install with sudo apt install unzip if unzip is missing.

bash
unzip -v | head -2
output
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Latest sources and executables are on ftp://ftp.info-zip.org/pub/infozip/ ;

The version line confirms the unzip package from the intro table is on PATH.


Download Gophish from GitHub

Pull the official linux-64bit archive for the version you set in GOPHISH_VERSION. Download it with curl command using -fL so redirects succeed and truncated HTML error pages fail the step.

bash
curl -fL -o "/tmp/gophish-v${GOPHISH_VERSION}-linux-64bit.zip" "https://github.com/gophish/gophish/releases/download/v${GOPHISH_VERSION}/gophish-v${GOPHISH_VERSION}-linux-64bit.zip"

When the download finishes, curl reports 100% of roughly 32 MB for v0.12.1.

Extract the ZIP into GOPHISH_DIR. The archive drops gophish, config.json, static/, templates/, and database migration SQL into that folder.

bash
unzip -o "/tmp/gophish-v${GOPHISH_VERSION}-linux-64bit.zip" -d "${GOPHISH_DIR}"
output
Archive:  /tmp/gophish-v0.12.1-linux-64bit.zip
  inflating: /root/gophish/gophish
  inflating: /root/gophish/config.json
  inflating: /root/gophish/README.md
  inflating: /root/gophish/VERSION
 ...

The gophish binary and config.json at the top of the listing are the two files you interact with most after install.

Mark the server binary executable before the first run.

bash
chmod +x "${GOPHISH_DIR}/gophish"

chmod exits silently on success. Next, confirm the bundle version matches the release tag.

bash
cat "${GOPHISH_DIR}/VERSION"
output
0.12.1

Configure config.json before first start

config.json in the install directory controls the admin HTTPS listener, the phishing HTTP listener, and the SQLite database path. Open it before the first start so port conflicts and exposure match your lab.

On my Kali VM, apache2 already listened on port 80. The stock phish_server value 0.0.0.0:80 would make Gophish exit with bind: address already in use. I changed the phishing listener to port 8080 and left the admin server on localhost.

The effective layout looks like this:

text
{
	"admin_server": {
		"listen_url": "127.0.0.1:3333",
		"use_tls": true,
		"cert_path": "gophish_admin.crt",
		"key_path": "gophish_admin.key",
		"trusted_origins": []
	},
	"phish_server": {
		"listen_url": "0.0.0.0:8080",
		"use_tls": false,
		"cert_path": "example.crt",
		"key_path": "example.key"
	},
	"db_name": "sqlite3",
	"db_path": "gophish.db",
	"migrations_prefix": "db/db_",
	"contact_address": "",
	"logging": {
		"filename": "",
		"level": ""
	}
}

Key fields to understand:

  • admin_server.listen_url — admin UI bind address; keep 127.0.0.1:3333 on a lab workstation unless you deliberately expose the console.
  • phish_server.listen_url — URL victims hit in campaigns; port 80 needs root or a free listener, so 8080 is a common lab alternative.
  • trusted_origins — add upstream proxy hostnames when TLS terminates in front of Gophish (v0.12.1+).
  • db_path — SQLite file created on first run; back it up before upgrades.
NOTE
Set contact_address to a reachable abuse or security mailbox when you expose the phishing listener beyond a closed lab. Gophish warns on start when it is empty.

Start Gophish and read the first-login password

From the install directory, run the binary in a terminal you can keep open (or under systemd later). The first start applies SQLite migrations and prints a one-time admin password.

bash
cd "${GOPHISH_DIR}" && ./gophish

On a fresh database you see migration lines followed by the generated password:

output
time="2026-08-02T13:16:45-04:00" level=warning msg="No contact address has been configured."
time="2026-08-02T13:16:45-04:00" level=warning msg="Please consider adding a contact_address entry in your config.json"
goose: migrating db environment 'production', current version: 0, target: 20220321133237
OK    20160118194630_init.sql
OK    20160131153104_0.1.2_add_event_details.sql
...
OK    20220321133237_0.4.1_envelope_sender.sql
time="2026-08-02T13:16:46-04:00" level=info msg="Please login with the username admin and the password 54190a1ef7868e3b"
time="2026-08-02T13:16:46-04:00" level=info msg="Starting phishing server at http://0.0.0.0:80"
time="2026-08-02T13:16:46-04:00" level=fatal msg="listen tcp 0.0.0.0:80: bind: address already in use"

Your password hash differs every fresh install. Copy the Please login line immediately; Gophish does not store that random password in a file.

After switching phish_server to 0.0.0.0:8080, a successful start ends with both listeners running:

output
time="2026-08-02T13:17:12-04:00" level=info msg="Creating new self-signed certificates for administration interface"
time="2026-08-02T13:17:12-04:00" level=info msg="Starting phishing server at http://0.0.0.0:8080"
time="2026-08-02T13:17:12-04:00" level=info msg="Background Worker Started Successfully - Waiting for Campaigns"
time="2026-08-02T13:17:12-04:00" level=info msg="TLS Certificate Generation complete"
time="2026-08-02T13:17:12-04:00" level=info msg="Starting admin server at https://127.0.0.1:3333"

Waiting for Campaigns means the worker is idle and the admin UI is ready for login.


Log in to the Gophish admin console

Open a browser on the Kali host and go to https://127.0.0.1:3333. Accept the self-signed certificate warning the first time Gophish generates gophish_admin.crt and gophish_admin.key.

Log in with username admin and the password from the terminal. Gophish forces a password reset on first login; pick a strong replacement and store it in your password manager.

After login you land on the dashboard. Sending profiles need SMTP hostnames and paths that match your lab mail setup; SMTP enumeration on Metasploitable or your own Postfix instance surfaces candidate addresses before you import targets. The left navigation maps to the objects you assemble before any campaign:

Console area Role in a phishing test
Dashboard Campaign result summaries and charts
Campaigns Launch and monitor simulations
Users & Groups Target lists (manual entry or CSV import)
Email Templates Message bodies and tracking pixels
Landing Pages Cloned sites and credential capture forms
Sending Profiles SMTP settings for outbound mail
Settings Reporting, IMAP, and UI preferences
User Management Additional admin accounts (RBAC)
Webhooks Real-time event push to external URLs

Walk through sending profiles, templates, and the launch wizard in the create phishing campaign with Gophish guide. For why department-specific lures matter, see social engineering attacks.


Upgrade Gophish

To move to a newer release, download the new ZIP, extract into a fresh directory, and copy (do not move) your existing gophish.db and any custom TLS files into that directory. Run the new binary from the new folder; migrations run automatically on start.

bash
export GOPHISH_VERSION="0.12.1"
export GOPHISH_DIR_NEW="${HOME}/gophish-${GOPHISH_VERSION}"
mkdir -p "${GOPHISH_DIR_NEW}"
curl -fL -o "/tmp/gophish-v${GOPHISH_VERSION}-linux-64bit.zip" "https://github.com/gophish/gophish/releases/download/v${GOPHISH_VERSION}/gophish-v${GOPHISH_VERSION}-linux-64bit.zip"
unzip -o "/tmp/gophish-v${GOPHISH_VERSION}-linux-64bit.zip" -d "${GOPHISH_DIR_NEW}"
cp "${HOME}/gophish/gophish.db" "${GOPHISH_DIR_NEW}/"
cp "${HOME}/gophish/config.json" "${GOPHISH_DIR_NEW}/"
chmod +x "${GOPHISH_DIR_NEW}/gophish"

Stop the old process before starting the new binary so only one instance holds your database and ports.


Stop and remove Gophish

Stop the running process from another terminal when you finish lab work.

bash
pkill -f "${GOPHISH_DIR}/gophish"

Remove the install tree and downloaded ZIP when you no longer need the lab copy.

bash
rm -rf "${GOPHISH_DIR}" "/tmp/gophish-v${GOPHISH_VERSION}-linux-64bit.zip"

Deleting gophish.db destroys campaign history. Archive it first if you need report screenshots for coursework or client deliverables.


Gophish install troubleshooting

Symptom Likely cause Fix
bind: address already in use on port 80 Apache, nginx, or another HTTP server on Kali Change phish_server.listen_url to 0.0.0.0:8080 or stop the conflicting service
bind on 127.0.0.1:3333 Another Gophish instance still running pkill -f gophish or pick a different admin port in config.json
Browser cannot reach admin UI Wrong URL or TLS trust Use https://127.0.0.1:3333, not http, and accept or replace the self-signed cert
Lost first-run password gophish.db already created Stop Gophish, remove gophish.db, and start again for a new random password (wipes data)
Campaign links fail off the VM Phishing listener bound to wrong port or firewall Match campaign URL port to phish_server.listen_url and open that port only in the lab network
No contact address warning Empty contact_address in config Set a valid mailbox before internet-facing phishing tests

References


Summary

You downloaded Gophish v0.12.1 from the official GitHub release, unpacked the linux-64bit ZIP on Kali, and made the gophish binary executable. Editing config.json before the first start avoids the common Kali pitfall where Apache already owns port 80; moving the phishing listener to 8080 lets the admin UI and phish server start together.

The first ./gophish run applies SQLite migrations and prints a one-time admin password in the terminal. Log in at https://127.0.0.1:3333, reset the password, and use the console navigation to confirm dashboard, templates, landing pages, and sending profiles are available. That console is the control plane for authorized simulations, not a shortcut for unsolicited email.

For the next lab step, wire SMTP, templates, and targets into a live campaign in the create phishing campaign with Gophish guide. Keep simulations on an isolated network from pentest lab setup and document authorization before any mail leaves your lab.


Frequently Asked Questions

1. What is the default Gophish admin username and password?

The default username is admin. Gophish prints a one-time random password in the terminal on first start when no gophish.db exists. Copy that password immediately, log in at https://127.0.0.1:3333, and set a new password when prompted.

2. Which ports does Gophish use?

The admin console defaults to HTTPS on 127.0.0.1:3333. The phishing listener defaults to HTTP on 0.0.0.0:80 in config.json. Change phish_server listen_url when port 80 is occupied or when you are not running as root.

3. Can I install Gophish with apt on Kali Linux?

Kali does not ship an official gophish package in the default repositories. Use the pre-built linux-64bit ZIP from the Gophish GitHub releases page, or clone the source and build with Go if you need a custom build.

4. Why does Gophish fail with bind address already in use?

Another service is listening on the port in config.json. On Kali, apache2 often holds port 80. Change phish_server listen_url to 0.0.0.0:8080 or stop the conflicting service before starting Gophish.

5. Is running Gophish phishing campaigns legal?

Phishing simulations are appropriate only with written authorization from the organization that owns the targets and mail infrastructure. Unauthorized phishing is illegal in most jurisdictions regardless of whether you use Gophish or manual email.
Kennedy Muthii

Information Security Analyst

Accomplished professional proficient in Python, ethical hacking, Linux, cybersecurity, and OSINT. With a track record including winning a national cybersecurity contest, launching a startup in Kenya, and holding a degree in information science, he is currently engaged in cutting-edge research in ethical hacking.

  • Python (programming language)
  • Certified Ethical Hacker
  • White Hat (Computer Security)
  • Linux
  • Penetration Testing