A method for manufacturing a hub unit bearing, the hub unit bearing including an outer ring, a hub, and a rolling element (5a, 5b) disposed between the outer ring and the hub, the hub including a first hub element, a second hub element, and a staking portion connecting the first hub element and the second hub element to each other, the manufacturing method comprising the steps of: preparing a holder (29, 29a); holding the second hub element, which is combined with the first hub element along a reference axis, on the holder (29, 29a); and forming the staking portion by using a die in a state in which (i) the second hub element is movable with respect to the holder in a direction orthogonal to the reference axis, or in a state in which (ii) the holder holding the second hub element is movable in the direction orthogonal to the reference axis, wherein the second hub element including a shaft portion provided with a track for the rolling element (5a, 5b) and a pilot portion provided at a shaft end portion of the shaft portion, the holder includes an insertion hole having an inner diameter larger than an outer diameter of the pilot portion of the second hub element, the step of holding the second hub element includes: holding the second hub element, which is combined with the first hub element along the reference axis, on the holder (29, 29a) in a state in which the pilot portion of the second hub element is inserted into the insertion hole of the holder; characterized by aligning a center axis of the second hub element to the reference axis with fitting an alignment jig to the pilot portion of the second hub element; and removing the alignment jig from the aligned second hub element, and the step of forming the staking portion includes forming the staking portion by using the die in a state in which the second hub element from which the alignment jig is removed is movable with respect to the holder in the direction orthogonal to the reference axis. preparing a holder (29, 29a); holding the second hub element, which is combined with the first hub element along a reference axis, on the holder (29, 29a); and forming the staking portion by using a die in a state in which (i) the second hub element is movable with respect to the holder in a direction orthogonal to the reference axis, or in a state in which (ii) the holder holding the second hub element is movable in the direction orthogonal to the reference axis, wherein the second hub element including a shaft portion provided with a track for the rolling element (5a, 5b) and a pilot portion provided at a shaft end portion of the shaft portion, the holder includes an insertion hole having an inner diameter larger than an outer diameter of the pilot portion of the second hub element, the step of holding the second hub element includes: holding the second hub element, which is combined with the first hub element along the reference axis, on the holder (29, 29a) in a state in which the pilot portion of the second hub element is inserted into the insertion hole of the holder; characterized by aligning a center axis of the second hub element to the reference axis with fitting an alignment jig to the pilot portion of the second hub element; and removing the alignment jig from the aligned second hub element, and holding the second hub element, which is combined with the first hub element along the reference axis, on the holder (29, 29a) in a state in which the pilot portion of the second hub element is inserted into the insertion hole of the holder; characterized by aligning a center axis of the second hub element to the reference axis with fitting an alignment jig to the pilot portion of the second hub element; and removing the alignment jig from the aligned second hub element, and the step of forming the staking portion includes forming the staking portion by using the die in a state in which the second hub element from which the alignment jig is removed is movable with respect to the holder in the direction orthogonal to the reference axis.