How to generate Sitemap

How should I generate a sitemap for my Gatsby website, I have hosted gatsby public folder files to plesk host server as there is no auto deploy feature as netlify provides. I know about the gatsby sitemap plugin but it can only generate sitemap on live website, If I will run below code locally it will give error as the site is not live ıs there any way to create the sitemap on local machine and then upload it to the host server or suggest me any other solution.

`gatsby-plugin-sitemap` ,
resolve: `gatsby-plugin-sitemap` ,
options: {
output: `./sitemap.xml/` ,
exclude: [ `/category/*` ],
query: `
site {
siteMetadata {

Or can I use this method to generate sitemap.