There is no obligation under federal bankruptcy law to remain in a home you own in order to file bankruptcy, whether that home is in foreclosure or not. You are permitted to move to a different jurisdiction and file your bankruptcy case there. You may also move to a different residence within the same Bankruptcy Court jurisdiction.
Note, however, that the federal bankruptcy law provides that if you have been living in a state for less than two years prior to filing your case, and if that State has more-favorable exemption provisions than the state you previously lived in, you CANNOT use the more-favorable provisions. (If you have no significant assets, this restriction may not be important.)
Details on managing a bankruptcy filing on your own can be found under Standard Legal’s Bankruptcy legal forms software.