Yes, there are document management systems that you can implement in your servers and locally host them. An example of a system available in an on-premise deployment is FileHold.
If you decide to go with an on-premise solution, keep in mind that there are additional costs to consider when self-hosting. These include hardware, software, and even the salary of a person who needs to maintain it from an IT perspective.