A diesel generator (is the combination of a diesel engine with an electric generator (often an alternator) to generate electrical energy. A diesel compression-ignition engine is usually designed to run on diesel fuel, but some types are adapted for other liquid fuels or natural gas.
Diesel generating sets are used in places without connection to a power grid, or as emergency power-supply if the grid fails, as well as for more complex applications such as peak-lopping, grid support and export to the power grid.