Install flask-lastuser from github rather than PyPI
Run processes as Ubuntu (not root)