0706.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Running HostMon in Docker</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <meta charset="UTF-8">
  7. <meta name="keywords" content="Install HostMon In Docker,Run HostMon In Docker,Application Dashboard,HostMon,Heimdall Alternative,DashMachine Alternative,Homer Alternative,Self-Hosted,Docker Made Easy,Service Monitoring,Browser Based,System Administration,Docker,Javascript,Express,Host Dashboard,Host Monitor,Install Guide,Linux,NodeJS,Home Lab,Ping,Web Based Tools,WOL,Wake-On-LAN,Web Based,Apache Guacamole,Docker Container,Docker Simplified,How To,Tutorial,i12bretro">
  8. <meta name="author" content="i12bretro">
  9. <meta name="description" content="Running HostMon in Docker">
  10. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  11. <meta name="revised" content="03/23/2022 09:17:27 AM" />
  12. <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
  13. <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
  14. <script type="text/javascript" src="includes/js/steps.js"></script>
  15. <link href="css/steps.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="gridContainer">
  19. <div class="topMargin"></div>
  20. <div id="listName" class="topMargin">
  21. <h1>Running HostMon in Docker</h1>
  22. </div>
  23. <div></div>
  24. <div id="content">
  25. <h2>What is HostMon?</h2>
  26. <blockquote>
  27. <p><em>HostMon is a simple web-based host monitor and application dashboard. It can be used to monitor the real-time status of hosts and services running in your homelab environment. In addition to monitoring, HostMon has built-in Wake-On-LAN (WOL) capability, SSH client, real-time ping output and the ability to link to your existing Apache Guacamole installation to remotely control hosts from the within browser.<br />
  28. <br />
  29. The HostMon application is written in javascript and uses a SQLite database backend. -<a href="https://github.com/i12bretro/HostMon" target="_blank">https://github.com/i12bretro/HostMon</a></em></p>
  30. </blockquote>
  31. <h2>Installing Docker</h2>
  32. <ol>
  33. <li>Log into the Linux based device</li>
  34. <li>Run the following commands in the terminal
  35. <div class="codeBlock"># install prerequisites<br />
  36. sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
  37. # add docker gpg key<br />
  38. curl -fsSL https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release)/gpg | sudo apt-key add -<br />
  39. # add docker software repository<br />
  40. sudo add-apt-repository &quot;deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F&#39;=&#39; &#39;/^ID=/{ print $NF }&#39; /etc/os-release) $(lsb_release -cs) stable&quot;<br />
  41. # install docker<br />
  42. sudo apt install docker-ce docker-compose containerd.io -y<br />
  43. # enable and start docker service<br />
  44. sudo systemctl enable docker &amp;&amp; sudo systemctl start docker<br />
  45. # add the current user to the docker group<br />
  46. sudo usermod -aG docker $USER<br />
  47. # reauthenticate for the new group membership to take effect<br />
  48. su - $USER</div>
  49. </li>
  50. </ol>
  51. <h2>Running HostMon</h2>
  52. <ol>
  53. <li>Now that Docker is installed, run the following commands to setup the HostMon Docker container and run it
  54. <div class="codeBlock"># create working directories<br />
  55. mkdir ~/docker/hostmon -p<br />
  56. # set owner of working directories<br />
  57. sudo chown &quot;$USER&quot;:&quot;$USER&quot; ~/docker -R<br />
  58. # create the hostmon docker container<br />
  59. docker create -ti --name hostmon i12bretro/hostmon<br />
  60. # export the hostmon database<br />
  61. docker cp hostmon:/app/data/hostmon.db ~/docker/hostmon/hostmon.db<br />
  62. # remove the temporary hostmon container<br />
  63. docker rm hostmon -f<br />
  64. # run hostmon with persistent database<br />
  65. docker run -d --name hostmon -v ~/docker/hostmon:/app/data -p 3000:3000 --restart=unless-stopped i12bretro/hostmon</div>
  66. </li>
  67. <li>Open a web browser and navigate to http://DNSorIP:3000</li>
  68. <li>Welcome to HostMon running in Docker</li>
  69. </ol>
  70. <p>Documentation: <a href="https://hub.docker.com/r/i12bretro/hostmon" target="_blank">https://hub.docker.com/r/i12bretro/hostmon</a></p>
  71. </div>
  72. </div>
  73. </body>
  74. </html>