A coffee machine having the following three modules detachably connected or assembled with each other: a main body that comprises a housing, a pot liner disposed within the housing, a heating mechanism for heating liquid in the pot liner, and a container disposed above the pot liner and being in communication with the inner space of the pot liner; a capsule base detachably connected on the bottom of the main body, which comprises a capsule holder for receiving a coffee capsule, a liquid outlet disposed below the capsule holder and being in communication with the capsule holder, wherein the capsule holder is suitable for being in communication with the inner space of the pot liner when the capsule base is connected to the main body; the machine being characterized by a power-controller holder detachably connected to the outside of the housing, for supporting, powering and controlling the main body; wherein the power-controller holder comprises: a substrate with a mounting socket disposed on the top surface thereof, a supporting part detachably connected to the mounting socket on the substrate, and detachably connected to the housing of the main body; wherein the supporting part comprises: a casing and a main rod disposed within the casing, for supporting the casing, wherein, the main rod has one end extending out from the casing, which is detachably mounted in the mounting socket of the substrate, and wherein the casing is detachably connected to the housing of the main body on one side thereof. a main body that comprises a housing, a pot liner disposed within the housing, a heating mechanism for heating liquid in the pot liner, and a container disposed above the pot liner and being in communication with the inner space of the pot liner; a capsule base detachably connected on the bottom of the main body, which comprises a capsule holder for receiving a coffee capsule, a liquid outlet disposed below the capsule holder and being in communication with the capsule holder, wherein the capsule holder is suitable for being in communication with the inner space of the pot liner when the capsule base is connected to the main body; the machine being characterized by a power-controller holder detachably connected to the outside of the housing, for supporting, powering and controlling the main body; wherein the power-controller holder comprises: a substrate with a mounting socket disposed on the top surface thereof, a supporting part detachably connected to the mounting socket on the substrate, and detachably connected to the housing of the main body; wherein the supporting part comprises: a casing and a main rod disposed within the casing, for supporting the casing, wherein, the main rod has one end extending out from the casing, which is detachably mounted in the mounting socket of the substrate, and wherein the casing is detachably connected to the housing of the main body on one side thereof. a substrate with a mounting socket disposed on the top surface thereof, a supporting part detachably connected to the mounting socket on the substrate, and detachably connected to the housing of the main body; wherein the supporting part comprises: a casing and a main rod disposed within the casing, for supporting the casing, wherein, the main rod has one end extending out from the casing, which is detachably mounted in the mounting socket of the substrate, and wherein the casing is detachably connected to the housing of the main body on one side thereof. a casing and a main rod disposed within the casing, for supporting the casing, wherein, the main rod has one end extending out from the casing, which is detachably mounted in the mounting socket of the substrate, and wherein the casing is detachably connected to the housing of the main body on one side thereof.