Source: https://www.palmbeachfederaldefense.com/blog/2018/12/what-is-the-difference-between-a-2255-and-a-2241-habeas-petition/
Timestamp: 2019-04-23 08:55:55+00:00

Document:
Habeas corpus is a kind of petition that you can file in federal court to claim that your imprisonment violates federal law, which includes federal statutes, and the U.S. Constitution. Whether you are a state or federal prisoner, a federal habeas petition claims that your imprisonment is illegal because your arrest, trial, or sentence violated federal law. If you believe that your imprisonment violates federal law, you can file a habeas petition regardless of whether your trial was in state court or federal court, and regardless of whether you are in a state prison or a federal prison.
A habeas petition is not a “direct appeal” of your conviction. Federal habeas is a “collateral appeal,” which is different from a direct appeal. A direct appeal challenges the merits of the judgment, but a collateral appeal challenges the procedure leading to the judgment. When you file a habeas petition, you are claiming that a mistake that violated federal law was made during your trial or sentencing. You can only make a habeas claim in federal court after making other appeals.
Habeas petitions for federal cases are made under either 28 U.S.C. § 2255 or 28 U.S.C. § 2241, depending on whether you are attacking the imposition of the sentence or the execution of the sentence.
What is a § 2255 petition used for?
When and where must a § 2255 petition be filed?
If your § 2255 petition is denied, you may appeal to your circuit’s Court of Appeals, but only if you first obtain a certificate of appealability (“COA”) from either the district court or the court of appeals. A § 2255 petition is considered “civil” in nature and the time allowed to appeal is 60 days.
Claims that attack the execution of a federal sentence by prison officials are raised by filing a § 2241 petition.
What is a § 2241 petition used for?
When and where must a § 2241 petition be filed?
§ 2241 petitions must be filed in the district of confinement and is not subject to time limitations. In addition, a federal prisoner seeking habeas corpus relief under § 2241 is not required to obtain a certificate of appealability to appeal the denial of relief.

References: § 2255
 § 2241
 § 2255
 § 2255
 § 2255
 § 2255
 § 2241
 § 2241
 § 2241

§ 2241
 § 2241