How can I save the joplin database in specific directory on Linux

On non-Windows systems the best way is to use a symlink.

I don't follow. What does this have to do with the profile directory? And what certificate and what password? Maybe you can open a new topic or search the existing ones about encryption. I don't use encryption and I don't know the code related to it, so I'm probably the wrong person to answer that question anyway.