Jump to content

Template LXC - Unifi


Go to solution Solved by bmartino1,

Recommended Posts

ICH777 temple implementation

https://github.com/bmartino1/Unriad-LXC-Unifi

 

Thank you, ICH 777 For all your work!
 

This is a test version and is being tested atm. A Full release will be done when ready.


Current Installation Steps:
 

1. Open a Unraid terminal and execute the following command to download the template:

wget -O /tmp/lxc_container_template.xml https://raw.githubusercontent.com/bmartino1/unraid-lxc-unifi/main/lxc_container_template.xml

 

2. Navigate to the Unraid LXC Plugin add Template Page: http://<Your_UnRAID_IP>/LXCAddTemplate

 

3. Make your changes if necessary. Container name/LXC hostname should be "unifi" to assist server inform host for device adoption...

 

4. Click Apply


5. Wait for the Done button, click Done
 

6. Open the unifi network application by going to your container IP

https://<Your_Container_IP>:8443

#**Disclaimer:**
This is a Debian OS running MongoDB 4.4 and Unifi network application

Waiting on Unifi for their next steps and if they will move to MongoDB 7 (I have tested this with MongoDB 7 with success in the past...)

MongoDB 3.6 is EOL!...
MongoDB 4.4 is now EOL!... 

https://community.ui.com/questions/Supported-Mongodb-version-is-EOL/6a97712b-2a58-4d96-8733-14b18c3ca063

Follow along and make your own Unraid LXC.

This process is modified to fit the unifi needs for a lxc, but otherwise follows the Unifi official posted documentations found here: 

https://help.ui.com/hc/en-us/articles/220066768-Updating-and-Installing-Self-Hosted-UniFi-Network-Servers-Linux

https://community.ui.com/questions/UniFi-Installation-Scripts-or-UniFi-Easy-Update-Script-or-UniFi-Lets-Encrypt-or-UniFi-Easy-Encrypt-/ccbc7530-dd61-40a7-82ec-22b17f027776

 

#License
**THIS IS AN UNOFFICIAL ADAPTATION!** This is Not Licensed nor endorsed by Unifi, Unraid, or LXC Plug Maintainer!
Please report problems on the unraid forum: https://forums.unraid.net/topic/171566-vm-lxc-unifi/

You are free to edit, distribute and change the data found in here to fit your needs.
 

Edited by bmartino1
Template add
Link to comment
  • Solution
Posted (edited)

To Use please install the LXC plugin:

image.png.ea3cd379e54cb7f10856a863a226ac9a.png

Please see the forum for support on this plugin:
https://forums.unraid.net/topic/123935-plugin-lxc-plugin/

Install Steps:

Open Unraid Terminal and download the template

wget -O /tmp/lxc_container_template.xml https://raw.githubusercontent.com/bmartino1/unraid-lxc-unifi/main/lxc_container_template.xml

 

image.thumb.png.5cba87f3a9129579c97c7cbde0cad0e2.png

 

Next go to the lxc Plugin Add Template Link

http://<Your_UnRAID_IP>/LXCAddTemplate

 

image.thumb.png.0d90cddf5502bccb03b4c9cef5c60f14.png


Make Your/Any necessary changes, if any.

Click Create

image.thumb.png.c461c24db201cf5cedb184a466542f17.png


Wait for the Done button and then Click Done.

 

image.thumb.png.ecda0f61d2dae7831215c93e1011b433.png

Congratulations. You now have a LXC Unifi Instance.

Start your instance and go to webui:

image.thumb.png.ba8100e2707eb767095610725f6f29bf.png


If prompted, click advance and Proceed to the Web interface:

image.png.f44cb1bfd904fb2a3bbde05f4ec8399e.png

 

You now ready to make your Unifi network interface:
image.thumb.png.9b635b8694d1e75d1c118fed8652444e.png

It is at this time you can restore form a unifi backup.
See forum on how to make a unifi backup:



Recommend Terminal commands to run after LXC creation.
 

 update packages in container:
 

apt-get update && apt-get upgrade -y

 

Be sure to set up your timezone (fix date and time) by running 

 

dpkg-reconfigure tzdata

 

set a root password:

 

passwd

 

Optional Package that are nifty to have:
 

apt-get install mc unattended-upgrades openssh-server nfs-common cifs-utils -y

^
MC is a terminal File explorer, Unatended-Upgrades is a auto policy security update program, OpenSSH-server add ssh terminal and SFTP access, NFS-common allows terminal commands for nfs shares, cifs-utils adds samba terminal command to connect to shares.


Remember, This is a Full Debian Instance running. You are in charge of updating and patching any CVEs.
There is a cron that should auto update and keep unifi up to date. 

^Auto Updates are a WIP Please report any issues on this forum. Please check the Repository for any upgrades per unifi decision regarding Mongodb 4.4 EOL and the direction it will take.

ATM this LXC is running these monitored services:
 

Unifi server application: https://ui.com/download/releases/network-server
Version: Network v 8.3.32 (Linux) as of 7/31/24
Ongoing until Unifi decides to kill...
 

Mongdb CE: https://www.mongodb.com/docs/manual/release-notes/7.0/
Version: MongoDB 7.0 Stable as of 7/31/24
EOL August 2026
EOL Info: https://www.mongodb.com/legal/support-policy/lifecycles


Debina OS Cycle: https://www.debian.org/releases/bookworm/
Version: Debian 12.6 bookwrom as of 7/31/24
EOL: June 30th, 2028

 

Edited by bmartino1
Step by Step...
Link to comment
56 minutes ago, bmartino1 said:

or is this a mater of maintaining?

It's a matter of maintaining, I can't give support to anyone if something is not working.

 

I hope you have also seen what I've posted here. This explains in detail what the maintainer and then the user have to do.

  • Thanks 1
Link to comment
  • bmartino1 changed the title to Template LXC - Unifi

I have very little knowledge of using github and git to make changes and updates to code.

I believe I have finished adding the minor changes, reviewing the code and appreciate your code comments and helping me edit / update this. Furthermore, I'm not sure what a build log is, I think I've been doing that right. 

I have updated the GitHub stuff to the best of my ability. I'm now testing the repository with a unraid setup and will post here with pictures and step by step here later for a marked solution.
 

Link to comment
10 hours ago, bmartino1 said:

I have updated the GitHub stuff to the best of my ability. I'm now testing the repository with a unraid setup and will post here with pictures and step by step here later for a marked solution.

You have to still upload the unifi.tar.xz package to the releases (this is a manual step but it could be automated) :

grafik.thumb.png.c0e9f82d36438a5d836a1dd09c685df5.png

 

So that it looks similar to that:
grafik.thumb.png.113e0cffc61f6a3c8ef6e714fd191f49.png

 

 

 

You'll find the build including the log file as described here:

 

grafik.png.b5ea3d6f2400fad1883309d604ab4e81.png

  • Thanks 1
Link to comment
1 hour ago, ich777 said:

You have to still upload the unifi.tar.xz package to the releases (this is a manual step but it could be automated) :

grafik.thumb.png.c0e9f82d36438a5d836a1dd09c685df5.png

 

So that it looks similar to that:
grafik.thumb.png.113e0cffc61f6a3c8ef6e714fd191f49.png

 

 

 

You'll find the build including the log file as described here:

 

grafik.png.b5ea3d6f2400fad1883309d604ab4e81.png

Thank you For all of this ICH777.

I misunderstood where the files created were at.
image.thumb.png.00a6bc53a9e82a1abae99f131838a57b.png

Repository is up and working with a few small edits. Forum post here is up and ready for Current user

I now have a better understanding and may make other LXC templates.
--Mainly for macvlan dockers to use ipvlan and lxc predefined mac address to fix other internal networking issues.

Link to comment

Attempted to update release. Current repository edits added to data.

New build log and template for production is published.

 

added unattended software upgrades for auto install of security updates.

added end user script to /root

 

cd /root


1 script is currently Cron this updates unifi, the other script can be run to fully update the system.

Link to comment
  • 4 weeks later...

with the update to unfi application 8.4.59-26648-1

one may need to open the lxc terminal and run 

sudo apt-get update --allow-releaseinfo-change
to move from 8.3 to 8.4

if you run apt-get update and get error:

E: Repository 'https://dl.ui.com/unifi/debian stable InRelease' changed its 'Codename' value from 'unifi-8.3' to 'unifi-8.4' N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

please run 

sudo apt-get update --allow-releaseinfo-change

 you may need to run this 2 times to allow the source list to update. and to upgrade unifi

apt-get update and apt-upgrade should work and install updates for mongdb and unifi
Remember to make a snapshot and or backup your unifi configurations before making updates.

image.thumb.png.76e47ad0b0f3eb1a8aa8ae41d227ddf6.png

testing before a update release appears on github.

https://github.com/bmartino1/Unriad-LXC-Unifi

Link to comment

DO to an oversite on how the script runs and updates. Theses files will need to be updated!

 

Users who have downloaded the previous release only need to update 2 scripts located in the root folder within the LXC.

These scripts are used in the cron job to update unifi automatically. and for later when we move from bookworm to the next stable release.

 

cd /root
ls

echo "Removing old files"
rm /root/update-unifi.sh
rm /root/full-system-update.sh

echo "grabbing new updated files"
cd /root
wget -O /root/update-unifi.sh https://raw.githubusercontent.com/bmartino1/unraid-lxc-unifi/main/build/update-unifi.sh
wget -O /root/full-system-update.sh https://raw.githubusercontent.com/bmartino1/unraid-lxc-unifi/main/build/update-system.sh

echo "making executable setting permissions"
cd /root
chmod 755 /root/update-unifi.sh
chmod 755 /root/full-system-update.sh

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...