In today’s digital world, QR codes have become ubiquitous tools for quickly sharing information, redirecting to websites, or facilitating contactless interactions. While many third-party QR code services exist, hosting your own QR code generator provides greater control, privacy, and customization options. This guide explores PHP Dynamic QR code, an excellent self-hosted solution that allows you to create both static and dynamic QR codes with ease.
What is PHP Dynamic QR Code?
PHP Dynamic QR Code is an open-source script that enables the generation and management of both dynamic and static QR codes. Created by Gian Donato Inverso, it has become one of the most popular self-hosted QR code generators on GitHub with over 300 stars. The application offers a clean, responsive, and user-friendly interface built on AdminLTE and Core PHP.
Key Features
- Dynamic QR Codes: Create, modify, and delete QR codes that can be updated without regenerating the code
- Static QR Codes: Generate various types including Text, Email, Phone, SMS, WhatsApp, Skype, Location, Vcard, Event/Calendar, Bookmark, WiFi, PayPal, and Bitcoin QR codes
- Advanced Dashboard: View comprehensive statistics on created QR codes and scans
- Multi-User Support: Control panel with different access levels
- Customization Options: 6 image formats, foreground/background colors, 4 precision levels, and 10 size options
- Bulk Operations: Download and delete QR codes in bulk
- URL Shortener: Built-in functionality with redirect options
Why Self-Host Your QR Code Generator?
Privacy and Data Control
When using third-party QR code services, your data and analytics often reside on external servers. By self-hosting, you maintain complete control over sensitive information and scan analytics.
No Subscription Fees
Most commercial QR code services charge monthly or annual fees for dynamic QR codes and analytics. A self-hosted solution eliminates these recurring costs.
Unlimited QR Codes
Create as many QR codes as needed without hitting usage limits or additional charges.
Customization Flexibility
Tailor the application to your specific requirements, potentially modifying the source code if necessary.
Offline Access
Once installed, your QR code generator works even without internet connectivity.
Installation with Docker
Docker provides the easiest way to set up PHP Dynamic QR Code. Here’s a step-by-step guide:
Prerequisites
- Docker and Docker Compose installed on your system
- Basic understanding of Docker containers
- A server or computer to host the application
Step 1: Create the Docker Compose File
Create a new directory for your installation and add a file named docker-compose.yml
with the following content:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
version: "3.2" services: php-dynamic-qrcode: image: "giandonatoinverso/php-dynamic-qr-code:latest" restart: "unless-stopped" environment: TYPE: "docker" BASE_URL: "http://localhost:5462" # Change to your domain if using one DATABASE_HOST: "php-dynamic-qrcode-db" DATABASE_PORT: "3306" DATABASE_NAME: "qrcode" DATABASE_USER: "qrcode" DATABASE_PASSWORD: "your-secure-password-1" # Change this DATABASE_PREFIX: "" DATABASE_CHARSET: "utf8" QRCODE_GENERATOR: "internal-chillerlan.qrcode" ports: - 5462:80 depends_on: - php-dynamic-qrcode-db volumes: - php_dynamic_qrcode_saved_qrcode_data:/var/www/html/saved_qrcode networks: - php-dynamic-qrcode-network php-dynamic-qrcode-db: image: "giandonatoinverso/php-dynamic-qr-code-db:latest" restart: "unless-stopped" volumes: - php_dynamic_qrcode_db_data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: "your-secure-password-2" # Change this MYSQL_DATABASE: "qrcode" MYSQL_USER: "qrcode" MYSQL_PASSWORD: "your-secure-password-1" # Same as DATABASE_PASSWORD above networks: - php-dynamic-qrcode-network volumes: php_dynamic_qrcode_db_data: php_dynamic_qrcode_saved_qrcode_data: networks: php-dynamic-qrcode-network: driver: bridge |
Make sure to:
- Replace
your-secure-password-1
andyour-secure-password-2
with strong passwords - Change
BASE_URL
to your domain if you’re using one (https://yourdomain.com
) or keep it ashttp://localhost:5462
for local testing
Step 2: Deploy the Application
Run the following command in the directory containing your docker-compose.yml
file:
1 2 3 |
docker compose up -d |
This command pulls the necessary images and starts the containers in detached mode.
Step 3: Access the Application
After deployment (allow about a minute for everything to start properly), access the application at:
http://localhost:5462
(if installed locally)https://yourdomain.com
(if you configured a domain)
Step 4: First Login
Log in with the default superadmin account:
- Username:
superadmin
- Password:
superadmin
Step 5: Change Default Credentials
Immediately after logging in, change the default credentials:
- Click on “Users” in the left navigation menu
- Click the edit (pencil) icon next to the superadmin user
- Update the username and password
- Click “Submit” to save changes
Using PHP Dynamic QR Code
Removing Demo Entries
When you first install the application, you’ll notice some demo QR codes. To remove them:
- Go to “Dynamic Qr Codes” → “List all”
- Check the box before “ID” to select all QR codes
- Choose “Delete” from the dropdown menu and click “Apply”
- Repeat the same process for “Static Qr Codes”
Creating QR Codes
Static QR Codes
Static QR codes contain fixed information that cannot be changed after creation. They’re ideal for permanent information like WiFi credentials, contact details, or unchanging URLs.
- Go to “Static Qr Codes” → “Add new”
- Select the QR code type (Text, Email, WiFi, etc.)
- Configure the appearance options:
- Foreground and background colors
- Precision level
- Size and filename
- Output format
- Enter the specific information for your chosen QR code type
- Click “Submit” to generate your QR code
Dynamic QR Codes
Dynamic QR codes point to a URL that can be changed later without regenerating the QR code. They’re perfect for marketing campaigns, menus, or any content that might need updating.
- Go to “Dynamic Qr Codes” → “Add new”
- Configure the appearance options
- Enter the destination URL
- Provide a filename
- Select the format and owner
- Click “Submit” to create your dynamic QR code
Managing Users
To add additional users:
- Go to “Users” → “+Add new”
- Enter username and password
- Select user type (Admin or Super admin)
- Click “Submit”
Benefits of Dynamic QR Codes
Unlike static QR codes, dynamic QR codes offer several advantages:
- Editable Content: Change the destination URL without reprinting the QR code
- Analytics: Track scans, locations, devices, and user behavior
- Faster Scanning: Dynamic QR codes typically scan faster than static ones
- Scheduled Campaigns: Deliver different content based on timing
- Short URLs: The embedded URL is shorter and cleaner
- Retargeting Capabilities: Can be used for online marketing retargeting
Customization Options
PHP Dynamic QR Code allows you to customize the interface appearance. Click the four squares icon in the top left corner to access personalization options, including:
- Color themes
- Menu layout and size
- Navigation bar options
- Sidebar presentation
Thoughts
Self-hosted PHP Dynamic QR Code provides a powerful, flexible, and cost-effective solution for generating and managing QR codes. By using Docker for installation, you can quickly deploy this useful tool without extensive server configuration. Whether you need QR codes for business, personal use, or inventory management, this self-hosted solution gives you complete control over your QR code generation and analytics.
Useful Links
By setting up your own QR code generator, you’ll gain independence from third-party services while enjoying enhanced privacy, unlimited usage, and complete control over your data.