Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    UniFi controller on pfSense

    Scheduled Pinned Locked Moved General pfSense Questions
    17 Posts 4 Posters 6.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jimpJ Offline
      jimp Rebel Alliance Developer Netgate
      last edited by

      Sounds like wherever it's keeping the database files is getting lost on each reboot. If you have /var and /tmp in RAM disks, try disabling that option. If you're on NanoBSD, there is likely no proper fix for that.

      It's best to not run that on pfSense anyhow, it's a very bloated Java app (but I repeat myself…)

      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

      Need help fast? Netgate Global Support!

      Do not Chat/PM for help!

      1 Reply Last reply Reply Quote 0
      • johnpozJ Online
        johnpoz LAYER 8 Global Moderator
        last edited by

        If you can not run it on a vm, you do know they sell a little cloud key https://www.ubnt.com/unifi/unifi-cloud-key/

        Or you could run it on a pi for example.  I don't think pfsense is the best place to run that application to be honest..  I run my on its own vm..  what is great about vms is the ability to take snapshots when moving to new versions, etc..

        the db should not be stored in var or tmp on a normal install.. Default place for the db would be /usr/lib/unifi/data/db

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

        1 Reply Last reply Reply Quote 0
        • jimpJ Offline
          jimp Rebel Alliance Developer Netgate
          last edited by

          Looks like it's /usr/local/share/java/unifi/data/db on FreeBSD, no reason that should be removed on reboot. Unless it's on NanoBSD and never gets written in the first place, though I'd expect a different error in that case.

          I run the unifi controller from my FreeBSD workstation and it's fine, though I only start it when I need it and then stop it.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • jahonixJ Offline
            jahonix
            last edited by

            VM, Cloud Key, PI.
            I wonder no-one even mentions what Netgate has to offer to run the Unifi controller software on.
            Helps pay the rent for some, doesn't it?  ;)

            1 Reply Last reply Reply Quote 0
            • johnpozJ Online
              johnpoz LAYER 8 Global Moderator
              last edited by

              Minnowboard is what $139… Can get the new Pi3 for $35, the unifi key is only $79 so maybe that is why they don't suggest them ;)

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

              1 Reply Last reply Reply Quote 0
              • jahonixJ Offline
                jahonix
                last edited by

                You have neither worked in marketing nor sales; you are a technician, right? I'm with you, just trying to escape sometimes.  :)

                1 Reply Last reply Reply Quote 0
                • johnpozJ Online
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  No never worked in marketing or sales, that sort of stuff never interested me..  Techy all the way for sure..  And that board looks good, have been meaning to pick up one to play with..  Sure it would rock running unifi controller for sure, prob make a pretty good plex server as well with that nice gig interface that pi3 is lacking..

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                  1 Reply Last reply Reply Quote 0
                  • jahonixJ Offline
                    jahonix
                    last edited by

                    I see, you're trying hard now!  ;D

                    1 Reply Last reply Reply Quote 0
                    • I Offline
                      ionutr
                      last edited by

                      I'm not using NanoBSD and /var and /tmp aren't in RAM disk. I need to run it on a machine that is always up, so this way it can store all logs. If I use it on a machine that isn't always on, it saves logs only when the machine with the controller is on and I prefer to use it on the pfSense machine, since this is the only machine (at least, at the moment) that other users don't have access to :)

                      I've searched and I have no unifi dir in /usr/local/share/java/ so… this should be the problem :) Any ideas?

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ Online
                        johnpoz LAYER 8 Global Moderator
                        last edited by

                        not having db there is not really an issue, where unifi controller install on your pfsense box?  This is where the db should be under the unifi folder in data/db folder.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                        1 Reply Last reply Reply Quote 0
                        • I Offline
                          ionutr
                          last edited by

                          Yep. It's /usr/local/UniFi/data/db I guess. So now I just have to figure out how to make sure I won't lose data if I reboot the machine or if it shutsdown due to power failure or stuff like that.

                          1 Reply Last reply Reply Quote 0
                          • johnpozJ Online
                            johnpoz LAYER 8 Global Moderator
                            last edited by

                            so your saying when you do a normal shutdown, or even power loss those files are deleted, or their size changes to new files?

                            An intelligent man is sometimes forced to be drunk to spend time with his fools
                            If you get confused: Listen to the Music Play
                            Please don't Chat/PM me for help, unless mod related
                            SG-4860 25.07.1 | Lab VMs 2.8, 25.07.1

                            1 Reply Last reply Reply Quote 0
                            • I Offline
                              ionutr
                              last edited by

                              After a reboot, those files are gone.

                              1 Reply Last reply Reply Quote 0
                              • jimpJ Offline
                                jimp Rebel Alliance Developer Netgate
                                last edited by

                                Most likely whatever startup script/action you're running is wiping all that out then. Those aren't in a place that would be removed by the firewall itself.

                                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                Need help fast? Netgate Global Support!

                                Do not Chat/PM for help!

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.