How soon after a bankruptcy can you sell your house?

You have to wait until it has been discharged or dismissed. At that time the trustee's jurisdiction (control) over the house reverts back to the owner.

However, if you need to do so while the bankruptcy is pending, you can petition the trustee to release the house, state the reason why it would be best to let the house be sold, and the trustee will make the decision whether it can be sold or not.