In the paper, a new method of long-term planning of operation and development of the distribution system, taking into account operational aspects such as power flows, power losses, voltage levels, and energy balances, is presented. The developed method allows for the allocation and selection of the power of Renewable Energy Sources (RES), control of energy storage (ES), curtailing of RES production (EC), and the development of the distribution grid (GD). Different types of RES and loads are considered, represented by generation/demand profiles reflecting their typical operating conditions. RES allocation indicates the node in the distribution system and the power level for each type of RES that may be built. Energy storage (ES) allows generation to be transferred from the demand valley to the peak load. Curtailment of RES generation indicates the moment and level of power by which generation will be reduced, while the grid development (GD) determines between which network nodes a new power line should be built. All these activities allow to minimize the costs of planning work and development of the distribution system at a specific level of energy consumption from RES in the analyzed distribution system using a Mixed Integer-Linear Programming (MILP).