Overview
Before deploying any ScaleTail service, you need to set up Tailscale authentication and configure your network. This guide walks you through generating auth keys and managing your Tailscale network (Tailnet).Generating Authentication Keys
Tailscale auth keys allow your Docker containers to automatically join your Tailnet without manual intervention.Steps to Create an Auth Key
Access the Admin Console
Navigate to the Tailscale Admin Console
Configure Key Settings
Set the following options based on your needs:
- Reusable: Enable if you plan to use this key for multiple devices
- Ephemeral: Enable if you want devices to be automatically removed when they go offline
- Pre-approved: Enable to skip device authorization
- Tags: Add tags to organize and apply ACL rules to your devices
Recommended Key Configuration
For ScaleTail deployments, we recommend the following settings:Enable this to use the same key across multiple service deployments
Keep disabled for persistent services that should remain in your network
Enable to allow automatic device authorization during deployment
Set an appropriate expiration period. Consider using tags with never-expiring keys for production services
Using Auth Keys in ScaleTail
Once you have your auth key, add it to your.env file:
.env
The
TS_AUTHKEY is automatically consumed by all ScaleTail service configurations through the Docker Compose environment variables.Managing Devices in Admin Console
Viewing Your Devices
After deploying a service, it will appear in your Machines page:- Machine Name: The hostname you specified in your
compose.yaml - IP Address: The Tailscale IP assigned to your container
- Status: Online/Offline status
- Last Seen: Timestamp of last activity
Key Management Tasks
Approving Devices
Approving Devices
If you didn’t use pre-approved keys, you’ll need to manually approve new devices:
- Go to the Machines page
- Find your device in the “Pending” section
- Click Approve to add it to your Tailnet
Configuring Device Tags
Configuring Device Tags
Removing Devices
Removing Devices
To remove a device from your Tailnet:
- Click on the device in the Machines page
- Click the … menu
- Select Delete
- Confirm the deletion
Renaming Devices
Renaming Devices
To change a device’s display name:
- Click on the device in the Machines page
- Click on the current name
- Enter a new name
- Save your changes
This is cosmetic and doesn’t affect the device’s hostname or DNS entries.
Access Control Lists (ACLs)
ACLs define which devices can communicate with each other in your Tailnet. This is crucial for security when running multiple services.Basic ACL Example
Here’s a simple ACL that allows all devices to communicate:Tagged ACL Example
For more granular control using tags:Edit your ACLs at https://login.tailscale.com/admin/acls
MagicDNS Configuration
MagicDNS automatically assigns DNS names to your devices based on their hostname.Enabling MagicDNS
- Go to DNS Settings
- Enable MagicDNS
- Optionally configure a custom domain suffix
Using MagicDNS with ScaleTail
When MagicDNS is enabled, uncomment theTS_ACCEPT_DNS line in your compose files:
jellyfin.your-tailnet.ts.netportainer.your-tailnet.ts.net
Security Best Practices
Rotate Keys Regularly
Generate new auth keys periodically and update your deployments to minimize exposure from compromised keys.
Use Tagged Keys
Apply tags to auth keys to automatically assign ACL rules to new devices.
Enable Key Expiration
Set expiration dates on auth keys to limit their lifetime and reduce security risks.
Monitor Device Activity
Regularly review the Machines page to identify and remove unused or suspicious devices.
Troubleshooting
Container fails to join Tailnet
Container fails to join Tailnet
Symptoms: Container starts but doesn’t appear in Tailscale admin consoleSolutions:
- Verify
TS_AUTHKEYis correctly set in your.envfile - Check that the auth key hasn’t expired
- Ensure the container has the
net_admincapability - Verify
/dev/net/tundevice is accessible
Auth key rejected
Auth key rejected
Symptoms: Error message about invalid or expired keySolutions:
- Generate a new auth key from the admin console
- Verify you copied the entire key string
- Check if the key has reached its usage limit (for non-reusable keys)
Device shows as offline
Device shows as offline
Symptoms: Device appears in admin console but shows offline statusSolutions:
- Check container logs:
docker compose logs tailscale - Verify network connectivity from the container
- Ensure health check is passing
- Restart the Tailscale container
Next Steps
Sidecar Pattern
Learn how the Docker sidecar pattern works in ScaleTail
Environment Variables
Complete reference for all Tailscale environment variables
Serve vs Funnel
Understand when to use Serve or Funnel for exposing services
Deploy a Service
Deploy your first ScaleTail service