How to compile,build and make package from source code of mattermost to be deployed on live server

“Compiling” actually means to build from source and you seem to have managed to do so, just for reference, this is the link I was given which talks about setting up the developer environment and compiling the project from source:

I’m not sure if a config.json file is included in the setup or if it can be generated with some command, but you can always use the bundled default config.json from your previous install so that it contains all the default values.