> ## Content Index
> Fetch the complete content index at: https://ostreff.info/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to build and install Mattermost plugins on FreeBSD
- URL: https://ostreff.info/how-to-install-mattermost-plugins-on-freebsd/
- Published: 2021-01-30T17:56:56.000Z
- Updated: 2021-01-31T10:38:44.000Z
- Author: Jordan Ostreff
- Tags: FreeBSD

I was unpleasantly surprised to find that all plugins published on [Mattermost plugin marketplace](https://integrations.mattermost.com/?ref=ostreff.info) are not working on installed server on FreeBSD. They all are failing to start - it doesn't matter did you enabled [linux64 emulation](https://docs.freebsd.org/en/books/handbook/linuxemu/?ref=ostreff.info) inside the OS. 

After some research I have found that the problematic area is easy visible from file packages.json - as example here I'm givin a snippet from [mattermost-plugin-jitsi](https://github.com/mattermost/mattermost-plugin-jitsi?ref=ostreff.info):

{  
"id": "jitsi",  
"name": "Jitsi",  
"description": "Jitsi audio and video conferencing plugin for Mattermost.",  
"homepage\_url": "[https://github.com/mattermost/mattermost-plugin-jitsi](https://github.com/mattermost/mattermost-plugin-jitsi?ref=ostreff.info)",  
"support\_url": "[https://github.com/mattermost/mattermost-plugin-jitsi/issues](https://github.com/mattermost/mattermost-plugin-jitsi/issues?ref=ostreff.info)",  
"release\_notes\_url": "[https://github.com/mattermost/mattermost-plugin-jitsi/releases/tag/v2.0.0](https://github.com/mattermost/mattermost-plugin-jitsi/releases/tag/v2.0.0?ref=ostreff.info)",  
"icon\_path": "assets/icon.svg",  
"version": "2.0.0",  
"min\_server\_version": "5.2.0",  
"server": {  
"executables": {  
"linux-amd64": "server/dist/plugin-linux-amd64",  
"darwin-amd64": "server/dist/plugin-darwin-amd64",  
"windows-amd64": "server/dist/plugin-windows-amd64.exe"  
}  
},

It's easy visible and clear that the source must be build for FreeBSD too. The good news is that GO language has excelent cross compiling features.

$GOOS $GOARCH  
aix ppc64  
android 386  
android amd64  
android arm  
android arm64  
darwin 386  
darwin amd64  
darwin arm  
darwin arm64  
dragonfly amd64  
freebsd 386  
freebsd amd64  
freebsd arm  
illumos amd64  
js wasm  
linux 386  
linux amd64  
linux arm  
linux arm64  
linux ppc64  
linux ppc64le  
linux mips  
linux mipsle  
linux mips64  
linux mips64le  
linux s390x  
netbsd 386  
netbsd amd64  
netbsd arm  
openbsd 386  
openbsd amd64  
openbsd arm  
openbsd arm64  
plan9 386  
plan9 amd64  
plan9 arm  
solaris amd64  
windows 386  
windows amd64

Edit the Makefile in this way:

```
cd server && env GOOS=linux GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-linux-amd64;
cd server && env GOOS=freebsd GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-freebsd-amd64;
cd server && env GOOS=darwin GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-darwin-amd64;
cd server && env GOOS=windows GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-windows-amd64.exe;

```

Change the packages.json and server/manifest.go files to include new supported architecture:

```
"server": {
    "executables": {
        "linux-amd64": "server/dist/plugin-linux-amd64",
        "freebsd-amd64": "server/dist/plugin-freebsd-amd64",           
        "darwin-amd64": "server/dist/plugin-darwin-amd64",
        "windows-amd64": "server/dist/plugin-windows-amd64.exe"
    }
},

```

If there are failures when building package, replace whole "server" section with:

```
"server": {
    "executable": "server/dist/plugin-freebsd-amd64"
},

```

Then build package using "gmake dist" to generate distribution into "dist/\*.gz". You can grab generated file and upload it to [your mattermost instance](https://slack.ostreff.info/?ref=ostreff.info) running on FreeBSD.