This paper addresses the optimal location and sizing of photovoltaic (PV) sources in isolated direct current (DC) electrical networks, considering time-varying load and renewable generation curves. The mathematical formulation of this problem corresponds to mixed-integer nonlinear programming (MINLP), which is reformulated via mixed-integer convex optimization: This ensures the global optimum solving the resulting optimization model via branch & bound and interior-point methods. The main idea of including PV sources in the DC grid is to minimize the daily energy losses and greenhouse emissions produced by diesel generators in isolated areas. The GAMS package is employed to solve the MINLP model, using mixed and integer variables; also, the CVX and MOSEK solvers are used to obtain solutions from the proposed mixed-integer convex model in the MATLAB. Numerical results demonstrate important reductions in the daily energy losses and the harmful gas emissions when PV sources are optimally integrated into DC grid.