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

**URL:** <https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188>\
**Category:** Troubleshooting\
**Created:** [June 14, 2023, 10:56am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188 "2023-06-14T10:56:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![omppatil](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@omppatil](https://forum.mattermost.com/u/omppatil)\
**Post date:** [June 14, 2023, 10:56am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/1 "2023-06-14T10:56:21Z")

</div>

I have made some custom changes in Mattermost source code and want to compile, build and make package, so i can deploy on the live server, where my customised mattermost can be deployed and accessed by custom url. I want help in understanding and implementing it.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 15, 2023, 3:35am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/2 "2023-06-15T03:35:24Z")

</div>

Hi @omppatil and welcome to the Mattermost forums!

Usually you will only need the build essentials for your distribution and you will need a copy of the matching `golang` version on your system and if you have all that, you can start with typing `make` in the root of the source code folder and see where it goes. If you encounter errors, let us know.

In the meantime I’m going to see if I can find documentation about this.

---

<div class="post-metadata">

**Author:** ![omppatil](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@omppatil](https://forum.mattermost.com/u/omppatil)\
**Post date:** [June 15, 2023, 4:46am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/3 "2023-06-15T04:46:31Z")

</div>

hi @agriesser I was able to compile run mattermost on my local system successfully. but how do i build from source code of both mattermost-server and mattermost-webapp folders and deploy the build to the server , as in when i do the following steps such as using “make build” command in “mattermost-server” local folder and “make build-client” command from “mattermost-server” local folder and one tar file was generated and i extracted that tar file on my server and saved it in opt/mattermost folder, but when i try to run using “./bin/mattermost” , it gives me “config file not found error”. My extracted tar does not contain config.json file in it. i even referred this following links [\<no title\> — Mattermost documentation](https://docs.mattermost.com/install/common-prod-deploy-tar.html) and [Install Mattermost server — Mattermost documentation](https://docs.mattermost.com/install/install-ubuntu-2004-mattermost.html),

---

<div class="post-metadata">

**Author:** ![omppatil](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@omppatil](https://forum.mattermost.com/u/omppatil)\
**Post date:** [June 15, 2023, 4:47am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/4 "2023-06-15T04:47:03Z")

</div>

and also referred [How to Install Mattermost on Ubuntu 22.04 - RoseHosting](https://www.rosehosting.com/blog/how-to-install-mattermost-on-ubuntu-22-04/)

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 16, 2023, 4:10am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/5 "2023-06-16T04:10:06Z")

</div>

“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:

> **[Developer setup](https://developers.mattermost.com/contribute/developer-setup/)**
>
> Find out how to set up your development environment for building, running, and testing Mattermost.

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.

---

<div class="post-metadata">

**Author:** ![agnivade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agnivade/32/3846_2.png) [@agnivade](https://forum.mattermost.com/u/agnivade)\
**Post date:** [June 16, 2023, 4:12am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/6 "2023-06-16T04:12:00Z")

</div>

A config.json is automatically generated if the server cannot find one.

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 16, 2023, 4:25am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/7 "2023-06-16T04:25:56Z")

</div>

Thanks Agniva for confirming my assumption!

---

<div class="post-metadata">

**Author:** ![omppatil](https://avatars.discourse-cdn.com/v4/letter/o/f4b2a3/32.png) [@omppatil](https://forum.mattermost.com/u/omppatil)\
**Post date:** [June 19, 2023, 6:38am UTC](https://forum.mattermost.com/t/how-to-compile-build-and-make-package-from-source-code-of-mattermost-to-be-deployed-on-live-server/16188/8 "2023-06-19T06:38:37Z")

</div>

Thank you for your help @agriesser and @agnivade
