The authors reviewed the statistics of winter diesel fuel consumption in the Russian Federation for 2000–2017, revealed a positive growth rate. On this fact, the relevance of the study was substantiated. The complexity and importance of the refining process leads to the need for digitalization of oil refineries. The object of the study is obtaining winter diesel fuel, taking into account transport costs. The subject of the study is digitalization of the oil refining process on the base of constructing the mathematical model for obtaining winter diesel fuel, taking into account delivery costs. Main research methods: retrospective data analysis, synthesis, comparison, linear programming methods. The authors considered two stages of winter diesel fuel production: dewaxing a mixture of stages of hydrocarbon raw materials on zeolite and subsequent compounding. For each stage, the authors compiled a system of equations describing the process. The authors also compiled a target function for obtaining winter diesel fuel, taking into account the costs of receiving and delivering. The obtained mathematical model can be used to ensure the required quality of winter diesel fuel (in terms of sulfur content, density and flash point).