TheyCallMeTojo There is last final step where you can point to the flarum setup and choose username, insert database data, etc. Are you doing this step on the web browser or by the SSH with php flarum install?
Mabe some screenshot of the 500 error can help to understand better. My server is not Ubuntu but Centos, on my VPS i do not have encountered particular issues.