I faced several challenges while setting up the Alta Labs Control Docker environment on macOS. This guide is designed to help others set it up efficiently, covering steps for creating networks, running containers, updating configurations, changing IPs, creating backups, and restoring the setup.
Contents
Part 1: Setting Up the Environment
- Creating a Docker network.
- Running and verifying the Alta Labs Control container.
Part 2: Applying Updates Inside the Container
- Updating software immediately after initial setup.
Part 3: Changing the Container IP and Updating the Setup
- Changing to a new IP range after Route10 is operational.
- Updating Nginx configuration.
- Verifying and troubleshooting the new setup.
Part 4: Backing Up the Environment
- Saving container states and network configurations.
Part 5: Restoring from Snapshots
- Recreating networks and containers from backups.
Additional Notes
Tips for regular updates, backups, and monitoring.
Important Notes:
- When creating the network for the first time, you must use the 192.168.x.x subnet, as the Route10 system relies on these IPs for initial setup.
- Once the initial setup is complete and Route10 is up and running, you can change the IP to any range that suits your network (e.g., 10.x.x.x).
- Before changing the IP, update the configurations in Alta Route10 first. This avoids potential IP conflicts and ensures continued access to the Alta Control Interface.
- Regular backups are critical to safeguard against server outages or activation issues (e.g., manage.alta.inc).
Part 1: Setting Up the Environment
Step 1: Create a Custom Docker Network
- Open your terminal and create a custom bridge network:
docker network create \\
--driver=bridge \\
--subnet=192.168.1.0/24 \\
custom_bridge
- Verify the network:
docker network inspect custom_bridge
Step 2: Run the Container
- Start the Alta Labs Control container with a static IP:
docker run -it \\
--privileged \\
--network custom_bridge \\
--ip 192.168.1.11 \\
-p 80:80 \\
-p 443:443 \\
--name control \\
<image_name>
Step 3: Verify the Setup
- Check the container’s IP:
docker exec -it control ip a
- Test connectivity and services:
ping 192.168.1.11
curl <http://192.168.1.11>
Part 2: Applying Updates Inside the Container
Important:
This step should be performed immediately after the initial container setup (Part 1), as the Route10 system requires a properly configured and updated environment for recognition.
Step 1: Update Software
- Access the container:
docker exec -it control bash
- Update software packages:
sudo apt update && sudo apt upgrade -y
- Verify installed versions as required by Alta Labs Control.
Part 3: Changing the Container IP and Updating the Setup
Once the initial setup is complete and Route10 is up and running, you can change the container’s IP to a range that suits your network needs. Most users may not want to use the 192.x.x.x range permanently.
Important:
Before proceeding, it is strongly recommended to update the IP configuration in Alta Route10 first. This ensures the container’s new IP does not conflict with existing devices. Failure to update Route10’s IP settings first may result in IP conflicts, causing loss of access to the Alta Control Interface.
Part 3.1: Changing the Container IP to a New Subnet
Step 1: Create a New Network
- Create a new bridge network with the desired subnet (e.g., 10.0.0.0/24):
docker network create \\
--driver=bridge \\
--subnet=10.0.0.0/24 \\
custom_bridge_10
- Verify:
docker network inspect custom_bridge_10
Step 2: Move the Container to the New Network
- Disconnect the container from the current network:
docker network disconnect custom_bridge control
- Connect the container to the new network with a specific IP:
docker network connect --ip 10.0.0.165 custom_bridge_10 control
- Verify:
docker network inspect custom_bridge_10
docker exec -it control ip a
Step 3: Test the New Configuration
- Ping the new IP:
ping 10.0.0.165
- Test accessibility of services:
curl <http://10.0.0.165>
Part 3.2: Updating Nginx Configuration
Step 1: Edit the Configuration File
- Open the Nginx configuration file:
sudo nano /etc/nginx/sites-available/default
- Ensure the proxy_pass or other relevant directives are updated:
location / {
proxy_pass <http://127.0.0.1:<backend-port>>;
}
Step 2: Restart Nginx
- Restart the Nginx service:
sudo systemctl restart nginx
Part 3.3: Verifying and Troubleshooting
- Check the container’s network configuration:
ip a
- Confirm the bridge configuration:
brctl show
- Monitor logs for issues:
tail -f /var/log/nginx/access.log
- Debug network traffic:
tcpdump -i eth0 host 10.0.0.165
Part 4: Backing Up the Environment
Step 1: Save the Container
- Commit the current container state:
docker commit control control_snapshot:latest
- Save the container snapshot:
docker save -o ~/Desktop/control_snapshot.tar control_snapshot:latest
Step 2: Backup the Network Configuration
- Save the network settings:
docker network inspect custom_bridge > ~/Desktop/custom_bridge_backup.json
Perform these backups regularly to ensure quick restoration in case of failure.
Part 5: Restoring from Snapshots
Step 1: Restore the Network
- Recreate the custom bridge:
docker network create \\
--driver=bridge \\
--subnet=192.168.1.0/24 \\
custom_bridge
- Verify against the backup JSON:
cat ~/Desktop/custom_bridge_backup.json
Step 2: Restore the Container
- Load the container snapshot:
docker load -i ~/Desktop/control_snapshot.tar
- Run the restored container:
docker run -it \\
--privileged \\
--network custom_bridge \\
--ip 192.168.1.11 \\
-p 80:80 \\
-p 443:443 \\
--name control \\
control_snapshot:latest
Additional Notes
- Regular Updates: Keep the container software updated:
sudo apt update && sudo apt upgrade -y
- Backup Best Practices:
- Save the container periodically:
docker commit control control_snapshot:latest
docker save -o ~/Desktop/control_snapshot.tar control_snapshot:latest
- Backup the network:
docker network inspect custom_bridge > ~/Desktop/custom_bridge_backup.json
- Monitoring and Troubleshooting:
- Monitor Nginx logs:
tail -f /var/log/nginx/access.log
- Debug traffic:
tcpdump -i eth0 host 192.168.1.1