I'm not a developer so I'm not totally sure what you mean, but @Gargron did an AP guide here:
If you just want to set up your own Mastodon instance, you can do it really easily through @mastohost :
Follow friends and discover new ones. Publish anything you want: links, pictures, text, video. This server is run by the main developers of the Mastodon project. Everyone is welcome as long as you follow our code of conduct!