The entanglement in a Hubbard chain of hardcore bosons is investigated. The analytic expression of the global entanglement in the ground state is derived. The divergence of the derivative of the global entanglement shows the quantum criticality of the ground state. For the thermal equilibrium state, the bipartite and the multipartite entanglement are evaluated. The entanglement decreases to zero at a certain temperature. The thermal entanglement is rapidly decreasing with the increase of the number of sites in the lattice. The bipartite thermal entanglement approaches a constant value at a certain number of sites while the multipartite entanglement eventually vanishes.