Adding in more devices to my portainer configuration in home network

February 27, 2023
While docker has gained mass popularity and lot of old sys admins are adapting docker in their workflows. Even adaptation into dev teams are rising. 
Portainer provides a UI for managing your docker environments, hosts etc. And is a useful tool to quickly manage docker environments. While many teams use portainer on a single host . You can expand your portainer to manage docker containers into many other devices too. 
I had too many things running on one of my homelab server powered by Intel Nuc. And i still had list of things that needed to in my home server. A weekan board , self hosted git , home assistant, password manager . etc .
I set up my old hp pavilion g6 laptop, Installed the ubuntu server in it. Was nearly about to add portainer there too. But I did not wanted the confusion. I didn't wanted two portainer inside my homelab setup. Which also meant that the numbers of portainer instances would be higher as I introduced more devices in near future. I still had plans to introduce another nuc and another macbook into it.
So, To add in another computer and add it as host in your exisitng portainer configuration, Make sure you first have set up in a way that two computers are discoverable for each other, Might be in same LAN.
After that, Install docker into your new computer , We are going to call this as agent now.  In agent device ensure that port 8000 is open. 
In portainer settings, Go to environments , Click on add environment.  You would be presented with option to select your environment 

Add environment

Click on Docker standalone. 
You would again be given option to configure your connection. Select on Edge Agent . 
Enter the name you would want to name this connection. 
Enter the portainer server URL ( i.e Current portainer url ) as agent would see it.
Screenshot 2023-02-27 at 10.40.50.png 300 KB

There is a section called more setting , You can chose checkin intervals and other meta data from there. 
When ready click on create There would be another window that would show you docker command to run on agent,  Copy this and run it on your agent.

Edge docker command

In couple of seconds your agent should be communicating with your main portainer , Anad it should be available in your home page for portainer. 

Screenshot 2023-02-27 at 10.42.15.png 219 KB


Now with this, It opens up ability for me to add in more stuffs into my homelab, Weekan , garafana-prometheus stack are coming soon.