This guide will help you get TOTPHog up and running quickly.
- Docker and Docker Compose (recommended)
- OR PHP 8.3+ with Composer (for manual installation)
The easiest way to run TOTPHog is using Docker:
docker run -d -p 8045:80 --name totphog damianovsky/totphogOpen http://localhost:8045 in your browser.
For a more configurable setup:
git clone https://github.com/damianovsky/totphog.git
cd totphog
docker-compose up -dYou can change the port using environment variables:
TOTPHOG_PORT=9000 docker-compose up -d-
Clone the repository:
git clone https://github.com/damianovsky/totphog.git cd totphog -
Install dependencies:
composer install
-
Start the development server:
php -S localhost:8045 -t public
By default, tokens are stored in /var/www/html/var/tokens.json inside the container. To persist data between container restarts:
docker run -d -p 8045:80 \
-v totphog-data:/var/www/html/var \
damianovsky/totphogOr with Docker Compose, the docker-compose.yml already includes a volume configuration.
- Open http://localhost:8045
- Click "Add Token" to add a new TOTP token
- Enter the token name and secret (or paste an
otpauth://URI) - View your codes in real-time
Add a token via API:
curl -X POST http://localhost:8045/api/v1/tokens \
-H "Content-Type: application/json" \
-d '{"name": "My App", "secret": "JBSWY3DPEHPK3PXP"}'Get the current code:
curl http://localhost:8045/api/v1/tokens/{id}/codeSee the API Reference for complete documentation.