Issue in setup discourse on ubuntu server

That’s true for a docker install, but a development install will likely need more than that.

Do you need a development setup?

You might try Beginners Guide to Install Discourse for Development using Docker, but if you want to do development you’ll likely want at least 4gb.