You would need a battery. Need to calculate how much energy you need during the night and the days when you might have low irradiance (winter, cloudy days, etc)
Unless you can't connect for some reason, you could also set the inverter to zero-export. This would prevent you from exporting to the grid, but having it as an option. For this you need a smart meter and maybe a contactor (to disconnect the grid)