git clone https://github.com/usememos/memos
Change profile.Data from memos/server/profile/profile.go (line 60) to your desired directly (/opt/memos)
cd memos/web
yarn && yarn build
cd ..
rm -rf server/dist
mv web/dist server
go build -o memos bin/server/main.go
Move resulting memos to your working directory
/path/to/memos -mode prod -port 9999
Thanks to GFC from Telegram for instructions