Yes, a portable generator can provide onboard electrical power for boats too small to have a marine genset installed. But if used incorrectly, a portable generator poses severe safety risks. When used diligently, however, a portable generator is safe to operate on a boat.