This paper presents a methodology to optimally share the available grid capacity among customer assets connected within a low voltage distribution grid. Distributed energy resources (DERs) and a new generation of loads such as heat pumps, thermal, hydrogen, electric storages, and vehicles are increasingly being connected to distribution grids. These DERs and loads are intermittent and it is essential to optimally control them for the safe operation of the grid. Additionally, there is increased interest in the local generation, production, trading, and consumption of energy. New regulations to establish local energy communities (LEC) have come to fruition among member nations across Europe. This is to provide a control, market, and legal framework for managing such distributed generators and flexibilities in low and medium-voltage distribution grids and conclusively empower end-users to democratize the energy system. Within a LEC, a local energy market (LEM) is to be implemented. A significant constraint of a LEM or energy accounting system is the grid settlement process. The grid should remain in a steady state when the bids in the market are executed. The methodology discussed in this paper will preemptively stabilize the grid and generate limiting profiles at various locations for individual flexibilities that are part of the local energy market. This is achieved by using an Optimal Capacity Management system which generates limiting profiles at the points of common couplings of various controllable devices in the grid. The controllable devices are required to maintain their active power injection and consumption within the generated limiting profiles to ensure optimum grid level. This will ensure that grid limits are maintained, which are simulated on a test feeder and also applied to a real network model from the Heimschuh pilot site in Styria, Austria.